Minor fix in the collection of the harness output.

Without this patch smokecurrent.log contains:

pod/twice..........................................................ok
x2p/s2p............................................................ok
All tests successful.
make[2]: *** [_test_tty] Error 141
make[1]: *** [_test] Error 141
make: *** [test_harness] Broken pipe

error while running harness target 'test_harness': 2 at /opt/perl/libs/local/share/perl/5.6.1/Test/Smoke.pm line 188

All tests successful.

Archived results...


With the patch:

pod/twice..........................................................ok
x2p/s2p............................................................ok
All tests successful.
Files=1530, Tests=200239, 513 wallclock secs (25.97 usr 3.67 sys + 269.20 cusr 18.60 csys = 317.44 CPU)
Result: PASS
make[2]: Leaving directory `/opt/perl/perl-5.10.x'
make[1]: Leaving directory `/opt/perl/perl-5.10.x'

All tests successful.

Archived results...


I believe this is related to:

#!/usr/bin/perl -wl
open FH, qq(echo "foo" ; echo "bar" |);
while (<FH>) {
  last if m/foo/;
}
close FH or do { die "Error closing: $! & $?\n"; }'
__END__

Output: Error closing:  & 13

(This was with perl-5.6.1, but note that this isn't reproduceable everywhere.)

diff -Naur old/lib/Test/Smoke/Smoker.pm new/lib/Test/Smoke/Smoker.pm
--- old/lib/Test/Smoke/Smoker.pm	2008-04-18 19:04:32.000000000 +0200
+++ new/lib/Test/Smoke/Smoker.pm	2008-08-08 17:51:18.000000000 +0200
@@ -634,6 +634,7 @@
     my( $self, $target, $extra ) = @_;
 
     my $seenheader = 0;
+    my $done = 0;
     my @failed = ( );
 
     my $harness_re1 = HARNESS_RE1();
@@ -644,8 +645,9 @@
     my $line;
     while ( $line = <$tst> ) {
         $self->{v} > 1 and $self->tty( $line );
+        $done and next;
 
-        $line =~ /All tests successful/ and push( @failed, $line ), last;
+        $line =~ /All tests successful/ and push( @failed, $line ) and $done = 1, next;
 
         $line =~ /Failed Test\s+Stat/ and $seenheader = 1, next;
         $seenheader or next;
@@ -684,6 +686,7 @@
 
     my $harness3_re = HARNESS3_RE();
     my $seenheader = 0;
+    my $done = 0;
     my @failed = ( );
 
     my $tst = $self->_make_fork( $target, $extra );
@@ -691,8 +694,9 @@
     my $line;
     while ( $line = <$tst> ) {
         $self->{v} > 1 and $self->tty( $line );
+        $done and next;
 
-        $line =~ /All tests successful/ and push( @failed, $line ), last;
+        $line =~ /All tests successful/ and push( @failed, $line ) and $done = 1, next;
 
         $line =~ /Test Summary Report/ and $seenheader = 1, next;
         $seenheader or next;

Reply via email to