diff options
author | Michael G. Schwern <schwern@pobox.com> | 2002-05-17 16:37:26 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-18 03:44:57 +0000 |
commit | 6e5a998b1cc5eddc2fb262c2e2e7f989bfb76f23 (patch) | |
tree | 999dff07e60a200808a7cc3d9ae2b3b572a80de2 /lib/Test | |
parent | 7dadce444419cb5cc2a17faf09d9ea75a7e4b67b (diff) | |
download | perl-6e5a998b1cc5eddc2fb262c2e2e7f989bfb76f23.tar.gz |
Test::Harness 2.21 -> 2.22
Message-ID: <20020518003726.GB358@ool-18b93024.dyn.optonline.net>
p4raw-id: //depot/perl@16668
Diffstat (limited to 'lib/Test')
-rw-r--r-- | lib/Test/Harness.pm | 4 | ||||
-rw-r--r-- | lib/Test/Harness/Changes | 5 | ||||
-rw-r--r-- | lib/Test/Harness/Straps.pm | 18 | ||||
-rw-r--r-- | lib/Test/Harness/t/strap-analyze.t | 26 | ||||
-rw-r--r-- | lib/Test/Harness/t/test-harness.t | 16 |
5 files changed, 59 insertions, 10 deletions
diff --git a/lib/Test/Harness.pm b/lib/Test/Harness.pm index fb2aa9acbc..ac3ac8e1c0 100644 --- a/lib/Test/Harness.pm +++ b/lib/Test/Harness.pm @@ -1,5 +1,5 @@ # -*- Mode: cperl; cperl-indent-level: 4 -*- -# $Id: Harness.pm,v 1.28 2002/05/06 04:44:29 schwern Exp $ +# $Id: Harness.pm,v 1.29 2002/05/17 23:04:11 schwern Exp $ package Test::Harness; @@ -22,7 +22,7 @@ use vars qw($VERSION $Verbose $Switches $Have_Devel_Corestack $Curtest $Have_Devel_Corestack = 0; -$VERSION = '2.21'; +$VERSION = '2.22'; $ENV{HARNESS_ACTIVE} = 1; diff --git a/lib/Test/Harness/Changes b/lib/Test/Harness/Changes index cfc1bff3b4..f715aecdd5 100644 --- a/lib/Test/Harness/Changes +++ b/lib/Test/Harness/Changes @@ -1,5 +1,10 @@ Revision history for Perl extension Test::Harness +2.22 Fri May 17 19:01:35 EDT 2002 + - Fixed parsing of #!/usr/bin/perl-current to not see a -t. + (RT #574) + - Fixed exit codes on MPE/iX + 2.21 Mon May 6 00:43:22 EDT 2002 - removed a bunch of dead code left over after 2.20's gutting. - The fix for the $^X "bug" added in 2.02 has been removed. It diff --git a/lib/Test/Harness/Straps.pm b/lib/Test/Harness/Straps.pm index 73cc0096ee..173b26bc61 100644 --- a/lib/Test/Harness/Straps.pm +++ b/lib/Test/Harness/Straps.pm @@ -1,12 +1,12 @@ # -*- Mode: cperl; cperl-indent-level: 4 -*- -# $Id: Straps.pm,v 1.4 2002/05/05 02:32:54 schwern Exp $ +# $Id: Straps.pm,v 1.6 2002/05/17 23:04:11 schwern Exp $ package Test::Harness::Straps; use strict; use vars qw($VERSION); use Config; -$VERSION = '0.10'; +$VERSION = '0.11'; use Test::Harness::Assert; use Test::Harness::Iterator; @@ -277,7 +277,7 @@ sub analyze_file { eval q{use vmsish "status"; $results{'exit'} = $?}; } else { - $results{'exit'} = $? / 256; + $results{'exit'} = _wait2exit($?); } $results{passing} = 0 unless $? == 0; @@ -286,6 +286,16 @@ sub analyze_file { return %results; } + +eval { require POSIX; &POSIX::WEXITSTATUS(0) }; +if( $@ ) { + *_wait2exit = sub { $_[0] >> 8 }; +} +else { + *_wait2exit = sub { POSIX::WEXITSTATUS($_[0]) } +} + + =begin _private =item B<_switches> @@ -306,7 +316,7 @@ sub _switches { $s .= " $ENV{'HARNESS_PERL_SWITCHES'}" if exists $ENV{'HARNESS_PERL_SWITCHES'}; $s .= join " ", qq[ "-$1"], map {qq["-I$_"]} $self->_filtered_INC - if $first =~ /^#!.*\bperl.*-\w*([Tt]+)/; + if $first =~ /^#!.*\bperl.*\s-\w*([Tt]+)/; close(TEST) or print "can't close $file. $!\n"; diff --git a/lib/Test/Harness/t/strap-analyze.t b/lib/Test/Harness/t/strap-analyze.t index 9636557060..f7da98c9c2 100644 --- a/lib/Test/Harness/t/strap-analyze.t +++ b/lib/Test/Harness/t/strap-analyze.t @@ -13,10 +13,7 @@ BEGIN { my $SAMPLE_TESTS = $ENV{PERL_CORE} ? 'lib/sample-tests' : 't/sample-tests'; use strict; - -use Test::More tests => 35; - -use_ok('Test::Harness::Straps'); +use Test::More; my $IsVMS = $^O eq 'VMS'; @@ -380,8 +377,29 @@ my %samples = ( { 'ok' => 1, actual_ok => 1 }, ] }, + + 'shbang_misparse' =>{ + passing => 1, + + 'exit' => 0, + 'wait' => 0, + + max => 2, + seen => 2, + + 'ok' => 2, + 'todo' => 0, + 'skip' => 0, + bonus => 0, + + details => [ ({ 'ok' => 1, actual_ok => 1 }) x 2 ] + }, ); +plan tests => (keys(%samples) * 2) + 1; + +use_ok('Test::Harness::Straps'); + $SIG{__WARN__} = sub { warn @_ unless $_[0] =~ /^Enourmous test number/ || $_[0] =~ /^Can't detailize/ diff --git a/lib/Test/Harness/t/test-harness.t b/lib/Test/Harness/t/test-harness.t index 4e416e076a..5bfdb4ed1d 100644 --- a/lib/Test/Harness/t/test-harness.t +++ b/lib/Test/Harness/t/test-harness.t @@ -364,6 +364,22 @@ my %samples = ( }, all_ok => 0, }, + 'shbang_misparse' => { + total => { + bonus => 0, + max => 2, + 'ok' => 2, + files => 1, + bad => 0, + good => 1, + tests => 1, + sub_skipped=> 0, + 'todo' => 0, + skipped => 0, + }, + failed => { }, + all_ok => 1, + }, ); plan tests => (keys(%samples) * 7) + 1; |