diff options
author | Andy Armstrong <andy@hexten.net> | 2007-12-20 17:49:07 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-12-20 18:25:46 +0000 |
commit | 69f36734c100b00aa1a0212b12ebd8485f366fef (patch) | |
tree | dba23e9d2268d78cb90b54cb8001d3549fbac634 /lib/Test | |
parent | 56d7a0868d14c11c08f61a0acccc9ee745b4e081 (diff) | |
download | perl-69f36734c100b00aa1a0212b12ebd8485f366fef.tar.gz |
bring Test::Harness up to 3.06
Message-Id: <5C57804B-6F71-4875-AEB6-C449F893E001@hexten.net>
Date: Thu, 20 Dec 2007 17:49:07 +0000
p4raw-id: //depot/perl@32673
Diffstat (limited to 'lib/Test')
-rw-r--r-- | lib/Test/Harness.pm | 4 | ||||
-rw-r--r-- | lib/Test/Harness/Changes | 8 | ||||
-rw-r--r-- | lib/Test/Harness/bin/prove | 2 | ||||
-rw-r--r-- | lib/Test/Harness/t/harness.t | 10 | ||||
-rw-r--r-- | lib/Test/Harness/t/nofork-mux.t | 10 | ||||
-rw-r--r-- | lib/Test/Harness/t/regression.t | 77 | ||||
-rw-r--r-- | lib/Test/Harness/t/state.t | 78 | ||||
-rw-r--r-- | lib/Test/Harness/t/unicode.t | 3 |
8 files changed, 106 insertions, 86 deletions
diff --git a/lib/Test/Harness.pm b/lib/Test/Harness.pm index b355362db7..155279f4da 100644 --- a/lib/Test/Harness.pm +++ b/lib/Test/Harness.pm @@ -40,11 +40,11 @@ Test::Harness - Run Perl standard test scripts with statistics =head1 VERSION -Version 3.05 +Version 3.06 =cut -$VERSION = '3.05'; +$VERSION = '3.06'; # Backwards compatibility for exportable variable names. *verbose = *Verbose; diff --git a/lib/Test/Harness/Changes b/lib/Test/Harness/Changes index e397b88507..c1e1e5a376 100644 --- a/lib/Test/Harness/Changes +++ b/lib/Test/Harness/Changes @@ -1,5 +1,13 @@ Revision history for Test-Harness +3.06 + - Skip t/unicode.t if PERL_UNICODE set. Fixes #31731. + Thanks Lukas. + - App::Prove::State no longer complains about tests that + are deleted. + - --state=new and --state=old now consider the modification time + of test scripts. + 3.05 2007-12-09 - Skip unicode.t if Encode unavailable - Support for .proverc files. diff --git a/lib/Test/Harness/bin/prove b/lib/Test/Harness/bin/prove index ec58d7a234..0888ac9967 100644 --- a/lib/Test/Harness/bin/prove +++ b/lib/Test/Harness/bin/prove @@ -164,7 +164,7 @@ possible, for example, to recreate the ordering of a shuffled test. Run only the tests that failed on the last run. # Run all tests -e $ prove -b --state=save + $ prove -b --state=save # Run failures $ prove -b --state=failed diff --git a/lib/Test/Harness/t/harness.t b/lib/Test/Harness/t/harness.t index 4da18fc1e9..a073bd6447 100644 --- a/lib/Test/Harness/t/harness.t +++ b/lib/Test/Harness/t/harness.t @@ -286,7 +286,7 @@ foreach my $test_args ( get_arg_sets() ) { 't/source_tests/harness_failure (Wstat: 0 Tests: 2 Failed: 1)', '[[reset]]', '[[red]]', - 'Failed test number(s):', + 'Failed test:', '[[reset]]', '[[red]]', '2', @@ -309,7 +309,7 @@ foreach my $test_args ( get_arg_sets() ) { 'Test Summary Report', '-------------------', 't/source_tests/harness_failure (Wstat: 0 Tests: 2 Failed: 1)', - 'Failed test number(s):', + 'Failed test:', '2', ); @@ -330,7 +330,7 @@ foreach my $test_args ( get_arg_sets() ) { 'Test Summary Report', '-------------------', 't/source_tests/harness_failure (Wstat: 0 Tests: 2 Failed: 1)', - 'Failed test number(s):', + 'Failed test:', '2', ); @@ -434,7 +434,7 @@ foreach my $test_args ( get_arg_sets() ) { 't/source_tests/harness_badtap (Wstat: 0 Tests: 2 Failed: 1)', '[[reset]]', '[[red]]', - 'Failed test number(s):', + 'Failed test:', '[[reset]]', '[[red]]', '2', @@ -469,7 +469,7 @@ foreach my $test_args ( get_arg_sets() ) { 'Test Summary Report', '-------------------', 't/source_tests/harness_failure (Wstat: 0 Tests: 2 Failed: 1)', - 'Failed test number(s):', + 'Failed test:', '2', ); diff --git a/lib/Test/Harness/t/nofork-mux.t b/lib/Test/Harness/t/nofork-mux.t index 1ab27b1916..23a0746176 100644 --- a/lib/Test/Harness/t/nofork-mux.t +++ b/lib/Test/Harness/t/nofork-mux.t @@ -1,17 +1,17 @@ #!/usr/bin/perl -w - BEGIN { - if( $ENV{PERL_CORE} ) { + if ( $ENV{PERL_CORE} ) { chdir 't'; - @INC = ('../lib', 'lib'); + @INC = ( '../lib', 'lib' ); } else { - use lib 't/lib'; + use lib 't/lib'; } } use strict; use NoFork; -require ($ENV{PERL_CORE} && '../lib/Test/Harness/') . 't/multiplexer.t'; +require( + ( $ENV{PERL_CORE} ? '../lib/Test/Harness/' : '' ) . 't/multiplexer.t' ); diff --git a/lib/Test/Harness/t/regression.t b/lib/Test/Harness/t/regression.t index 46fc5e307d..80902df361 100644 --- a/lib/Test/Harness/t/regression.t +++ b/lib/Test/Harness/t/regression.t @@ -2357,45 +2357,44 @@ my %samples = ( wait => 0, version => 12, }, - - # switches => { - # results => [ - # { is_plan => TRUE, - # passed => TRUE, - # is_ok => TRUE, - # raw => '1..1', - # tests_planned => 1, - # }, - # { actual_passed => TRUE, - # is_actual_ok => TRUE, - # passed => TRUE, - # is_ok => TRUE, - # is_test => TRUE, - # has_skip => FALSE, - # has_todo => FALSE, - # number => 1, - # description => "", - # explanation => '', - # }, - # ], - # __ARGS__ => { switches => ['-Mstrict'] }, - # plan => '1..1', - # passed => [1], - # actual_passed => [1], - # failed => [], - # actual_failed => [], - # todo => [], - # todo_passed => [], - # skipped => [], - # good_plan => TRUE, - # is_good_plan => TRUE, - # tests_planned => 1, - # tests_run => TRUE, - # parse_errors => [], - # 'exit' => 0, - # wait => 0, - # version => 12, - # }, + switches => { + results => [ + { is_plan => TRUE, + passed => TRUE, + is_ok => TRUE, + raw => '1..1', + tests_planned => 1, + }, + { actual_passed => TRUE, + is_actual_ok => TRUE, + passed => TRUE, + is_ok => TRUE, + is_test => TRUE, + has_skip => FALSE, + has_todo => FALSE, + number => 1, + description => "", + explanation => '', + }, + ], + __ARGS__ => { switches => ['-Mstrict'] }, + plan => '1..1', + passed => [1], + actual_passed => [1], + failed => [], + actual_failed => [], + todo => [], + todo_passed => [], + skipped => [], + good_plan => TRUE, + is_good_plan => TRUE, + tests_planned => 1, + tests_run => TRUE, + parse_errors => [], + 'exit' => 0, + wait => 0, + version => 12, + }, inc_taint => { results => [ { is_plan => TRUE, diff --git a/lib/Test/Harness/t/state.t b/lib/Test/Harness/t/state.t index 0963a7e9b0..7ec4cfd611 100644 --- a/lib/Test/Harness/t/state.t +++ b/lib/Test/Harness/t/state.t @@ -1,21 +1,25 @@ #!/usr/bin/perl -w -use strict; -use lib 't/lib'; +BEGIN { + if ( $ENV{PERL_CORE} ) { + chdir 't'; + @INC = '../lib'; + } + else { + unshift @INC, 't/lib'; + } +} +use strict; use Test::More; use App::Prove::State; -my @schedule = ( +sub mn { + my $pfx = $ENV{PERL_CORE} ? '../lib/Test/Harness/' : ''; + return map {"$pfx$_"} @_; +} - # last => sub { - # failed => sub { - # passed => sub { - # all => sub { - # todo => sub { - # hot => sub { - # save => sub { - # adrian => sub { +my @schedule = ( { options => 'all', get_tests_args => [], expect => [ @@ -127,23 +131,23 @@ my @schedule = ( { options => 'old', get_tests_args => [], expect => [ - 't/compat/env.t', - 't/compat/failure.t', + 't/source.t', 't/compat/inc_taint.t', 't/compat/version.t', - 't/source.t', 't/yamlish-writer.t', + 't/compat/failure.t', + 't/compat/env.t', ], }, { options => 'new', get_tests_args => [], expect => [ - 't/source.t', - 't/yamlish-writer.t', - 't/compat/inc_taint.t', - 't/compat/version.t', 't/compat/env.t', 't/compat/failure.t', + 't/yamlish-writer.t', + 't/compat/version.t', + 't/compat/inc_taint.t', + 't/source.t', ], }, ); @@ -162,11 +166,11 @@ for my $test (@schedule) { $options = [$options] unless 'ARRAY' eq ref $options; $state->apply_switch(@$options); - my @got = $state->get_tests( @{ $test->{get_tests_args} } ); - - unless ( is_deeply \@got, $test->{expect}, "$desc: order OK" ) { + my @got = $state->get_tests( @{ $test->{get_tests_args} } ); + my @expect = mn( @{ $test->{expect} } ); + unless ( is_deeply \@got, \@expect, "$desc: order OK" ) { use Data::Dumper; - diag( Dumper( { got => \@got, want => $test->{expect} } ) ); + diag( Dumper( { got => \@got, want => \@expect } ) ); } } @@ -174,7 +178,7 @@ sub get_state { return { 'generation' => '51', 'tests' => { - 't/compat/failure.t' => { + mn('t/compat/failure.t') => { 'last_result' => '0', 'last_run_time' => '1196371471.57738', 'last_pass_time' => '1196371471.57738', @@ -182,9 +186,10 @@ sub get_state { 'seq' => '1549', 'gen' => '51', 'elapsed' => 0.1230, - 'last_todo' => '1' + 'last_todo' => '1', + 'mtime' => 1196285623, }, - 't/yamlish-writer.t' => { + mn('t/yamlish-writer.t') => { 'last_result' => '0', 'last_run_time' => '1196371480.5761', 'last_pass_time' => '1196371480.5761', @@ -193,9 +198,10 @@ sub get_state { 'seq' => '1578', 'gen' => '49', 'elapsed' => 12.2983, - 'last_todo' => '0' + 'last_todo' => '0', + 'mtime' => 1196285400, }, - 't/compat/env.t' => { + mn('t/compat/env.t') => { 'last_result' => '0', 'last_run_time' => '1196371471.42967', 'last_pass_time' => '1196371471.42967', @@ -204,9 +210,10 @@ sub get_state { 'seq' => '1548', 'gen' => '52', 'elapsed' => 3.1290, - 'last_todo' => '0' + 'last_todo' => '0', + 'mtime' => 1196285739, }, - 't/compat/version.t' => { + mn('t/compat/version.t') => { 'last_result' => '2', 'last_run_time' => '1196371472.96476', 'last_pass_time' => '1196371472.96476', @@ -215,9 +222,10 @@ sub get_state { 'seq' => '1555', 'gen' => '51', 'elapsed' => 0.2363, - 'last_todo' => '4' + 'last_todo' => '4', + 'mtime' => 1196285239, }, - 't/compat/inc_taint.t' => { + mn('t/compat/inc_taint.t') => { 'last_result' => '3', 'last_run_time' => '1196371471.89682', 'last_pass_time' => '1196371471.89682', @@ -225,9 +233,10 @@ sub get_state { 'seq' => '1551', 'gen' => '51', 'elapsed' => 1.6938, - 'last_todo' => '0' + 'last_todo' => '0', + 'mtime' => 1196185639, }, - 't/source.t' => { + mn('t/source.t') => { 'last_result' => '0', 'last_run_time' => '1196371479.72508', 'last_pass_time' => '1196371479.72508', @@ -235,7 +244,8 @@ sub get_state { 'seq' => '1570', 'gen' => '51', 'elapsed' => 0.0143, - 'last_todo' => '0' + 'last_todo' => '0', + 'mtime' => 1186285639, }, } }; diff --git a/lib/Test/Harness/t/unicode.t b/lib/Test/Harness/t/unicode.t index 837a053fcc..b5b767e5ee 100644 --- a/lib/Test/Harness/t/unicode.t +++ b/lib/Test/Harness/t/unicode.t @@ -12,6 +12,9 @@ BEGIN { plan skip_all => "unicode on Perl < 5.8.0" unless $] > 5.008; + plan skip_all => "PERL_UNICODE set" + if $ENV{PERL_UNICODE}; + eval "use File::Temp"; plan skip_all => "File::Temp unavailable" if $@; |