diff options
author | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-11-27 14:59:03 +0000 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-11-27 14:59:03 +0000 |
commit | fac76ed70b2818d69c47c57bd5b63a636a19a037 (patch) | |
tree | 310939b53c9b5c385da8f3d8f239782000df18ea /lib/Test | |
parent | 6027b9a35019f02a9b3e344c2f78856358da6033 (diff) | |
download | perl-fac76ed70b2818d69c47c57bd5b63a636a19a037.tar.gz |
Output skipped test information in test suite:
Subject: 5.004_55: Making test harness platform_aware
Date: Wed, 26 Nov 1997 17:16:55 -0500 (EST)
Date: Wed, 26 Nov 1997 17:16:55 -0500 (EST)
p4raw-id: //depot/perl@318
Diffstat (limited to 'lib/Test')
-rw-r--r-- | lib/Test/Harness.pm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Test/Harness.pm b/lib/Test/Harness.pm index f5fc3d8cc5..37f4a9fbde 100644 --- a/lib/Test/Harness.pm +++ b/lib/Test/Harness.pm @@ -73,6 +73,7 @@ sub runtests { $fh->open($cmd) or print "can't run $test. $!\n"; $ok = $next = $max = 0; @failed = (); + my $skipped = 0; while (<$fh>) { if( $verbose ){ print $_; @@ -87,10 +88,11 @@ sub runtests { if (/^not ok\s*(\d*)/){ $this = $1 if $1 > 0; push @failed, $this; - } elsif (/^ok\s*(\d*)/) { + } elsif (/^ok\s*(\d*)(\s*\#\s*[Ss]kip)?/) { $this = $1 if $1 > 0; $ok++; $totok++; + $skipped++ if defined $2; } if ($this > $next) { # warn "Test output counter mismatch [test $this]\n"; @@ -142,7 +144,10 @@ sub runtests { estat => $estatus, wstat => $wstatus, }; } elsif ($ok == $max && $next == $max+1) { - if ($max) { + if ($max and $skipped) { + my $ender = 's' x ($skipped > 1); + print "ok, $skipped subtest$ender skipped on this platform\n"; + } elsif ($max) { print "ok\n"; } else { print "skipping test on this platform\n"; @@ -328,6 +333,11 @@ The global variable $Test::Harness::switches is exportable and can be used to set perl command line options used for running the test script(s). The default value is C<-w>. +If the standard output line contains substring C< # Skip> (with +variations in spacing and case) after C<ok> or C<ok NUMBER>, it is +counted as a skipped test. If the whole testscript succeeds, the +count of skipped tests is included in the generated output. + =head1 EXPORT C<&runtests> is exported by Test::Harness per default. |