|
From: <jgr...@us...> - 2003-07-26 18:28:30
|
Update of /cvsroot/popfile/engine/Devel
In directory sc8-pr-cvs1:/tmp/cvs-serv15772/Devel
Modified Files:
TestCoverage.pm
Log Message:
Remove all tabs from the source code and fix my editor so that *I* don't introduce any more
Index: TestCoverage.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Devel/TestCoverage.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** TestCoverage.pm 26 Jul 2003 14:59:46 -0000 1.9
--- TestCoverage.pm 26 Jul 2003 18:28:27 -0000 1.10
***************
*** 19,26 ****
BEGIN
{
! # We want to look inside subroutines so tell the debugger to trace into
! # them
! $DB::trace = 1;
}
--- 19,26 ----
BEGIN
{
! # We want to look inside subroutines so tell the debugger to trace into
! # them
! $DB::trace = 1;
}
***************
*** 29,51 ****
sub DB
{
! # The caller function we till us what line of code, in which file and
! # package called us
! my ($package, $file, $line) = caller;
! # A specific line in a specific file just got executed, we remove
! # certain references to eval code that we wont have traced into
! $count{$file}{$line} += 1 if ( ( $file =~ /\(eval/ ) == 0 );
}
END
{
! # Print out information for each file
! for my $file (keys %count)
! {
! if ( ( $file =~ /^[^\/]/ ) && ( $file ne '../tests.pl' ) && !( $file =~ /^..\/\/Test\// ) ) {
! my $current_line = 0;
my $block_executed = 0;
!
! open SOURCE_FILE, "<$file";
my $clean = $file;
$clean =~ s/^\.\.\/\///;
--- 29,51 ----
sub DB
{
! # The caller function we till us what line of code, in which file and
! # package called us
! my ($package, $file, $line) = caller;
! # A specific line in a specific file just got executed, we remove
! # certain references to eval code that we wont have traced into
! $count{$file}{$line} += 1 if ( ( $file =~ /\(eval/ ) == 0 );
}
END
{
! # Print out information for each file
! for my $file (keys %count)
! {
! if ( ( $file =~ /^[^\/]/ ) && ( $file ne '../tests.pl' ) && !( $file =~ /^..\/\/Test\// ) ) {
! my $current_line = 0;
my $block_executed = 0;
!
! open SOURCE_FILE, "<$file";
my $clean = $file;
$clean =~ s/^\.\.\/\///;
***************
*** 53,78 ****
open LINE_DATA, ">$clean.$$.lne";
! # Read in each line of the source file and keep track of whether
! # it was executed or not using a new couple of keys in the
! # %count hash for each file: total_lines, total_executable_lines
! # and total_executed
! while (<SOURCE_FILE>)
! {
! # Keep count of the total number of lines in this file
! $current_line += 1;
!
! # We do not count lines that are blank or exclusively
! # comments or just have braces on them or
! # just an else or just a subroutine definition
! if ( ( ( /^\s*\#/ == 0 ) &&
( /^\s*$/ == 0 ) &&
( /^\s*(\{|\}|else|\s)+\s*$/ == 0 ) &&
( /^\s*sub \w+( \{)?\s*$/ == 0 ) &&
( /^\s*package / == 0 ) ) || ( $block_executed ) ) {
! $count{$file}{total_executable_lines} += 1;
!
! # If this line was executed then keep count of
! # that fact
!
if ( ( $count{$file}{$current_line} > 0 ) || ( $block_executed ) ) {
print LINE_DATA "1\n";
--- 53,78 ----
open LINE_DATA, ">$clean.$$.lne";
! # Read in each line of the source file and keep track of whether
! # it was executed or not using a new couple of keys in the
! # %count hash for each file: total_lines, total_executable_lines
! # and total_executed
! while (<SOURCE_FILE>)
! {
! # Keep count of the total number of lines in this file
! $current_line += 1;
!
! # We do not count lines that are blank or exclusively
! # comments or just have braces on them or
! # just an else or just a subroutine definition
! if ( ( ( /^\s*\#/ == 0 ) &&
( /^\s*$/ == 0 ) &&
( /^\s*(\{|\}|else|\s)+\s*$/ == 0 ) &&
( /^\s*sub \w+( \{)?\s*$/ == 0 ) &&
( /^\s*package / == 0 ) ) || ( $block_executed ) ) {
! $count{$file}{total_executable_lines} += 1;
!
! # If this line was executed then keep count of
! # that fact
!
if ( ( $count{$file}{$current_line} > 0 ) || ( $block_executed ) ) {
print LINE_DATA "1\n";
***************
*** 82,101 ****
# in the block if the first line was
! if ( /\# PROFILE BLOCK START/ ) {
$block_executed = 1;
! }
! if ( /\# PROFILE BLOCK STOP/ ) {
$block_executed = 0;
! }
! } else {
print LINE_DATA "0\n";
}
! } else {
print LINE_DATA "\n";
}
! }
!
! close SOURCE_FILE;
close LINE_DATA;
--- 82,101 ----
# in the block if the first line was
! if ( /\# PROFILE BLOCK START/ ) {
$block_executed = 1;
! }
! if ( /\# PROFILE BLOCK STOP/ ) {
$block_executed = 0;
! }
! } else {
print LINE_DATA "0\n";
}
! } else {
print LINE_DATA "\n";
}
! }
!
! close SOURCE_FILE;
close LINE_DATA;
***************
*** 104,108 ****
if ( $block_executed ) {
print "WARNING: unterminated PROFILE BLOCK detected; did you forget a PROFILE BLOCK STOP in $file?\n";
! }
}
}
--- 104,108 ----
if ( $block_executed ) {
print "WARNING: unterminated PROFILE BLOCK detected; did you forget a PROFILE BLOCK STOP in $file?\n";
! }
}
}
|