Update of /cvsroot/popfile/engine/Devel
In directory sc8-pr-cvs1:/tmp/cvs-serv5644/Devel
Modified Files:
TestCoverage.pm
Log Message:
Make test runner merge data from forked subprocesses to give one set of output data on coverage
Index: TestCoverage.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Devel/TestCoverage.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TestCoverage.pm 13 Jul 2003 02:40:35 -0000 1.7
--- TestCoverage.pm 13 Jul 2003 05:21:21 -0000 1.8
***************
*** 40,46 ****
END
{
- # This hash will map file names of POPFile modules to coverage
- my %files;
-
# Print out information for each file
for my $file (keys %count)
--- 40,43 ----
***************
*** 51,54 ****
--- 48,55 ----
open SOURCE_FILE, "<$file";
+ my $clean = $file;
+ $clean =~ s/^\.\.\/\///;
+ $clean =~ s/\//-/g;
+ open LINE_DATA, ">$clean.$$.lne";
# Read in each line of the source file and keep track of whether
***************
*** 60,64 ****
# Keep count of the total number of lines in this file
$current_line += 1;
- $count{$file}{total_lines} += 1;
# We do not count lines that are blank or exclusively
--- 61,64 ----
***************
*** 76,80 ****
if ( ( $count{$file}{$current_line} > 0 ) || ( $block_executed ) ) {
! $count{$file}{total_executed} += 1;
# Check to see if the special comment PROFILE BLOCK START is on the line
--- 76,80 ----
if ( ( $count{$file}{$current_line} > 0 ) || ( $block_executed ) ) {
! print LINE_DATA "1\n";
# Check to see if the special comment PROFILE BLOCK START is on the line
***************
*** 90,111 ****
}
} else {
! print "$file:$current_line $_" if ( $file =~/WordMangle/);
}
! }
!
}
- $files{$file} = int(100 * $count{$file}{total_executed} / $count{$file}{total_executable_lines}) unless ( $count{$file}{total_executable_lines} == 0 );
-
close SOURCE_FILE;
}
}
-
- foreach my $file (sort {$files{$b} <=> $files{$a}} keys %files) {
- my $clean = $file;
- $clean =~ s/^\.\.\/\///;
-
- print sprintf( "Coverage of %-32s %d%%\n", "$clean...", $files{$file});
- }
}
--- 90,104 ----
}
} else {
! print LINE_DATA "0\n";
}
! } else {
! print LINE_DATA "\n";
! }
}
close SOURCE_FILE;
+ close LINE_DATA;
}
}
}
|