summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-09-22 13:30:16 -0400
committerGurusamy Sarathy <gsar@cpan.org>1998-09-23 10:58:36 +0000
commit89d3b7e251e9bb072e8bc269628849f3fee64a20 (patch)
treea9d2448d1e87ba474806e433b81aa2e9ebc7ce3b
parent38d592acc8cc6c79ec9758c8a21a6032333dec96 (diff)
downloadperl-89d3b7e251e9bb072e8bc269628849f3fee64a20.tar.gz
More verbose Test::Harness [PATCH]
Message-Id: <199809222130.RAA17034@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@1857
-rw-r--r--lib/Test/Harness.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/Test/Harness.pm b/lib/Test/Harness.pm
index 9c61d3a9dd..935e8f07d2 100644
--- a/lib/Test/Harness.pm
+++ b/lib/Test/Harness.pm
@@ -160,7 +160,7 @@ sub runtests {
} else {
push @failed, $next..$max;
$failed = @failed;
- (my $txt, $canon) = canonfailed($max,@failed);
+ (my $txt, $canon) = canonfailed($max,$skipped,@failed);
$percent = 100*(scalar @failed)/$max;
print "DIED. ",$txt;
}
@@ -173,7 +173,7 @@ sub runtests {
} elsif ($ok == $max && $next == $max+1) {
if ($max and $skipped + $bonus) {
my @msg;
- push(@msg, "$skipped subtest".($skipped>1?'s':'')." skipped")
+ push(@msg, "$skipped/$max subtest".($skipped>1?'s':'')." skipped")
if $skipped;
push(@msg, "$bonus subtest".($bonus>1?'s':'').
" unexpectedly succeeded")
@@ -191,7 +191,7 @@ sub runtests {
push @failed, $next..$max;
}
if (@failed) {
- my ($txt, $canon) = canonfailed($max,@failed);
+ my ($txt, $canon) = canonfailed($max,$skipped,@failed);
print $txt;
$failedtests{$test} = { canon => $canon, max => $max,
failed => scalar @failed,
@@ -300,7 +300,7 @@ sub corestatus {
}
sub canonfailed ($@) {
- my($max,@failed) = @_;
+ my($max,$skipped,@failed) = @_;
my %seen;
@failed = sort {$a <=> $b} grep !$seen{$_}++, @failed;
my $failed = @failed;
@@ -330,7 +330,12 @@ sub canonfailed ($@) {
}
push @result, "\tFailed $failed/$max tests, ";
- push @result, sprintf("%.2f",100*(1-$failed/$max)), "% okay\n";
+ push @result, sprintf("%.2f",100*(1-$failed/$max)), "% okay";
+ my $ender = 's' x ($skipped > 1);
+ my $good = $max - $failed - $skipped;
+ my $goodper = sprintf("%.2f",100*($good/$max));
+ push @result, " (-$skipped skipped test$ender: $good okay, $goodper%)" if $skipped;
+ push @result, "\n";
my $txt = join "", @result;
($txt, $canon);
}