From: Jarkko Hietaniemi Date: Sun, 27 Jul 2003 19:20:45 +0000 (+0000) Subject: Upgrade to Test::Harness 2.29. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=27caa5c10b08266a9617a2ffa79bff9b3e7a01ef;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Test::Harness 2.29. p4raw-id: //depot/perl@20238 --- diff --git a/lib/Test/Harness.pm b/lib/Test/Harness.pm index 609c23f..cc1dd32 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.47 2003/04/24 19:33:05 andy Exp $ +# $Id: Harness.pm,v 1.52 2003/07/17 19:02:48 andy Exp $ package Test::Harness; @@ -22,7 +22,7 @@ use vars qw($VERSION $Verbose $Switches $Have_Devel_Corestack $Curtest $Have_Devel_Corestack = 0; -$VERSION = '2.28'; +$VERSION = '2.29'; $ENV{HARNESS_ACTIVE} = 1; @@ -898,7 +898,7 @@ sub _create_fmts { } } -sub canonfailed ($@) { +sub canonfailed ($$@) { my($max,$skipped,@failed) = @_; my %seen; @failed = sort {$a <=> $b} grep !$seen{$_}++, @failed; diff --git a/lib/Test/Harness/Straps.pm b/lib/Test/Harness/Straps.pm index 058070b..dc3e4b6 100644 --- a/lib/Test/Harness/Straps.pm +++ b/lib/Test/Harness/Straps.pm @@ -358,13 +358,7 @@ sub _INC2PERL5LIB { $self->{_old5lib} = $ENV{PERL5LIB}; - my @filtered_inc = $self->_filtered_INC; - my @clean_inc = grep !/\Q$Config{path_sep}/, @filtered_inc; - my @naughty_inc = grep /\Q$Config{path_sep}/, @filtered_inc; - warn "Test::Harness can't handle \@INC directories with ". - "'$Config{path_sep}': @naughty_inc\n" if @naughty_inc; - - return join $Config{path_sep}, @clean_inc; + return join $Config{path_sep}, $self->_filtered_INC; } =item B<_filtered_INC> diff --git a/lib/Test/Harness/t/assert.t b/lib/Test/Harness/t/assert.t index 9ff7305..11a4ed7 100644 --- a/lib/Test/Harness/t/assert.t +++ b/lib/Test/Harness/t/assert.t @@ -12,9 +12,9 @@ BEGIN { use strict; -use Test::More tests => 6; +use Test::More tests => 7; -use Test::Harness::Assert; +use_ok( 'Test::Harness::Assert' ); ok( defined &assert, 'assert() exported' ); diff --git a/lib/Test/Harness/t/callback.t b/lib/Test/Harness/t/callback.t index d774958..646e81f 100644 --- a/lib/Test/Harness/t/callback.t +++ b/lib/Test/Harness/t/callback.t @@ -43,10 +43,11 @@ my $SAMPLE_TESTS = $ENV{PERL_CORE} test other other test other )], ); -plan tests => scalar keys %samples; +plan tests => 2 + scalar keys %samples; -use Test::Harness::Straps; +use_ok( 'Test::Harness::Straps' ); my $strap = Test::Harness::Straps->new; +isa_ok( $strap, 'Test::Harness::Straps' ); $strap->{callback} = sub { my($self, $line, $type, $totals) = @_; push @out, $type; diff --git a/lib/Test/Harness/t/strap-analyze.t b/lib/Test/Harness/t/strap-analyze.t index b42c875..70f973d 100644 --- a/lib/Test/Harness/t/strap-analyze.t +++ b/lib/Test/Harness/t/strap-analyze.t @@ -460,7 +460,7 @@ my %samples = ( }, ); -plan tests => (keys(%samples) * 4) + 3; +plan tests => (keys(%samples) * 5) + 4; use_ok('Test::Harness::Straps'); @@ -480,6 +480,7 @@ while( my($test, $expect) = each %samples ) { my $test_path = File::Spec->catfile($SAMPLE_TESTS, $test); my $strap = Test::Harness::Straps->new; + isa_ok( $strap, 'Test::Harness::Straps' ); my %results = $strap->analyze_file($test_path); is_deeply($results{details}, $expect->{details}, "$test details" ); @@ -507,5 +508,6 @@ while( my($test, $expect) = each %samples ) { my $strap = Test::Harness::Straps->new; +isa_ok( $strap, 'Test::Harness::Straps' ); ok( !$strap->analyze_file('I_dont_exist') ); is( $strap->{error}, "I_dont_exist does not exist" ); diff --git a/lib/Test/Harness/t/strap.t b/lib/Test/Harness/t/strap.t index a69f0c6..d74ea64 100644 --- a/lib/Test/Harness/t/strap.t +++ b/lib/Test/Harness/t/strap.t @@ -12,14 +12,12 @@ BEGIN { use strict; -use Test::More tests => 147; - +use Test::More tests => 170; use_ok('Test::Harness::Straps'); my $strap = Test::Harness::Straps->new; -ok( defined $strap && $strap->isa("Test::Harness::Straps"), 'new()' ); - +isa_ok( $strap, 'Test::Harness::Straps', 'new()' ); ### Testing _is_comment() @@ -39,6 +37,7 @@ my %comments = ( while( my($line, $line_comment) = each %comments ) { my $strap = Test::Harness::Straps->new; + isa_ok( $strap, 'Test::Harness::Straps' ); my $name = substr($line, 0, 20); ok( $strap->_is_comment($line, \$comment), " comment '$name'" ); @@ -104,6 +103,7 @@ my %headers = ( while( my($header, $expect) = each %headers ) { my $strap = Test::Harness::Straps->new; + isa_ok( $strap, 'Test::Harness::Straps' ); ok( $strap->_is_header($header), "_is_header() is a header '$header'" ); @@ -185,6 +185,8 @@ my @untests = ( ); foreach my $line (@untests) { my $strap = Test::Harness::Straps->new; + isa_ok( $strap, 'Test::Harness::Straps' ); + my %test = (); ok( !$strap->_is_test($line, \%test), "_is_test() disregards '$line'" ); @@ -204,6 +206,8 @@ my %bails = ( while( my($line, $expect) = each %bails ) { my $strap = Test::Harness::Straps->new; + isa_ok( $strap, 'Test::Harness::Straps' ); + my $reason; ok( $strap->_is_bail_out($line, \$reason), "_is_bail_out() spots '$line'"); is( $reason, $expect, ' with the right reason' ); @@ -218,6 +222,8 @@ my @unbails = ( foreach my $line (@unbails) { my $strap = Test::Harness::Straps->new; + isa_ok( $strap, 'Test::Harness::Straps' ); + my $reason; ok( !$strap->_is_bail_out($line, \$reason), diff --git a/lib/Test/Harness/t/test-harness.t b/lib/Test/Harness/t/test-harness.t index 8a5f687..1af1144 100644 --- a/lib/Test/Harness/t/test-harness.t +++ b/lib/Test/Harness/t/test-harness.t @@ -472,8 +472,8 @@ my %samples = ( plan tests => (keys(%samples) * 8) + 1; -use Test::Harness; use_ok('Test::Harness'); +use Test::Harness; # So that we don't get "used only once" warnings on the next line $Test::Harness::Switches = '"-Mstrict"'; tie *NULL, 'My::Dev::Null' or die $!;