In perl.git, the branch smoke-me/updated-cpan-toolchain has been updated <http://perl5.git.perl.org/perl.git/commitdiff/3dc863200a8f347700534f9359939796edfb4779?hp=f05c65233e98bfec4a0387acb27e9dae1083b297>
- Log ----------------------------------------------------------------- commit 3dc863200a8f347700534f9359939796edfb4779 Author: Chris 'BinGOs' Williams <[email protected]> Date: Sun Jun 3 21:35:21 2012 +0100 Updated Test-Harness to CPAN version 3.24 [DELTA] 3.24 2012-06-03 - RT #74393: corrected typo in M::B integration docs. - RT #63473: fix typo. - RT #49732: Attempt to load File::Glob::Windows to get correct glob semantics on Win32. - RT #47890: Don't use Win32::GetShortPathName. - RT #64404: Ignore textness ('-T') of script when reading shebang. - Handle the case where we don't know the wait status of the test more gracefully. - Make the test summary 'ok' line overrideable so that it can be changed to a plugin to make the output of prove idempotent. - Apply upstream patch: http://perl5.git.perl.org/perl.git/commit \ /6359c64336d99060952232e7e300bd3c31afead8 In testargs.t in Test::Harness, don't run a world-writable file. The test writes a file, then changes the mode, then executes it. The file needs to be +x to be executable (on many platforms). The file will need to be +w to be deletable on some platforms. But setting the file world writable just before running it feels like a bad idea, given that the file's name is as predictable as process IDs, as there's a race condition to break into the account running perl's tests. ----------------------------------------------------------------------- Summary of changes: MANIFEST | 2 + Porting/Maintainers.pl | 2 +- cpan/Test-Harness/Changes | 25 +++++ cpan/Test-Harness/MANIFEST | 3 + cpan/Test-Harness/MANIFEST.CUMMULATIVE | 2 + cpan/Test-Harness/bin/prove | 2 +- cpan/Test-Harness/lib/App/Prove.pm | 5 +- cpan/Test-Harness/lib/App/Prove/State.pm | 67 ++++++++++---- cpan/Test-Harness/lib/App/Prove/State/Result.pm | 4 +- .../lib/App/Prove/State/Result/Test.pm | 4 +- cpan/Test-Harness/lib/TAP/Base.pm | 4 +- cpan/Test-Harness/lib/TAP/Formatter/Base.pm | 28 +++++-- cpan/Test-Harness/lib/TAP/Formatter/Color.pm | 4 +- cpan/Test-Harness/lib/TAP/Formatter/Console.pm | 4 +- .../lib/TAP/Formatter/Console/ParallelSession.pm | 4 +- .../lib/TAP/Formatter/Console/Session.pm | 6 +- cpan/Test-Harness/lib/TAP/Formatter/File.pm | 4 +- .../Test-Harness/lib/TAP/Formatter/File/Session.pm | 6 +- cpan/Test-Harness/lib/TAP/Formatter/Session.pm | 9 ++- cpan/Test-Harness/lib/TAP/Harness.pm | 6 +- cpan/Test-Harness/lib/TAP/Object.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser.pm | 6 +- cpan/Test-Harness/lib/TAP/Parser/Aggregator.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Grammar.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Iterator.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Iterator/Array.pm | 4 +- .../lib/TAP/Parser/Iterator/Process.pm | 4 +- .../Test-Harness/lib/TAP/Parser/Iterator/Stream.pm | 4 +- .../Test-Harness/lib/TAP/Parser/IteratorFactory.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Multiplexer.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Result.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Result/Bailout.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Result/Comment.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Result/Plan.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Result/Pragma.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Result/Test.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Result/Unknown.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Result/Version.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Result/YAML.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/ResultFactory.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Scheduler.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Scheduler/Job.pm | 4 +- .../lib/TAP/Parser/Scheduler/Spinner.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Source.pm | 30 +++---- cpan/Test-Harness/lib/TAP/Parser/SourceHandler.pm | 4 +- .../lib/TAP/Parser/SourceHandler/Executable.pm | 4 +- .../lib/TAP/Parser/SourceHandler/File.pm | 4 +- .../lib/TAP/Parser/SourceHandler/Handle.pm | 4 +- .../lib/TAP/Parser/SourceHandler/Perl.pm | 7 +- .../lib/TAP/Parser/SourceHandler/RawTAP.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/Utils.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/YAMLish/Reader.pm | 4 +- cpan/Test-Harness/lib/TAP/Parser/YAMLish/Writer.pm | 4 +- cpan/Test-Harness/lib/Test/Harness.pm | 28 +++++- cpan/Test-Harness/t/compat/env.opts.t | 56 ++++++++++++ cpan/Test-Harness/t/harness.t | 93 +++++++++++++------- cpan/Test-Harness/t/nowarn.t | 10 ++ cpan/Test-Harness/t/prove.t | 26 +++--- cpan/Test-Harness/t/source.t | 7 +- cpan/Test-Harness/t/source_handler.t | 12 ++-- t/porting/customized.dat | 2 +- 61 files changed, 394 insertions(+), 194 deletions(-) create mode 100644 cpan/Test-Harness/t/compat/env.opts.t create mode 100644 cpan/Test-Harness/t/nowarn.t diff --git a/MANIFEST b/MANIFEST index 307e1cb..d8eae7c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2316,6 +2316,7 @@ cpan/Test-Harness/t/aggregator.t Test::Harness test cpan/Test-Harness/t/bailout.t Test::Harness test cpan/Test-Harness/t/base.t Test::Harness test cpan/Test-Harness/t/callbacks.t Test::Harness test +cpan/Test-Harness/t/compat/env.opts.t cpan/Test-Harness/t/compat/env.t Test::Harness test cpan/Test-Harness/t/compat/failure.t Test::Harness test cpan/Test-Harness/t/compat/inc-propagation.t Test::Harness test @@ -2360,6 +2361,7 @@ cpan/Test-Harness/t/multiplexer.t Test::Harness test cpan/Test-Harness/t/nested.t Test::Harness test cpan/Test-Harness/t/nofork-mux.t Test::Harness test cpan/Test-Harness/t/nofork.t Test::Harness test +cpan/Test-Harness/t/nowarn.t cpan/Test-Harness/t/object.t Test::Harness test cpan/Test-Harness/t/parser-config.t Test::Harness test cpan/Test-Harness/t/parser-subclass.t Test::Harness test diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 3934248..9da179c 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -1727,7 +1727,7 @@ use File::Glob qw(:case); 'Test::Harness' => { 'MAINTAINER' => 'andya', - 'DISTRIBUTION' => 'ANDYA/Test-Harness-3.23.tar.gz', + 'DISTRIBUTION' => 'OVID/Test-Harness-3.24.tar.gz', 'FILES' => q[cpan/Test-Harness], 'EXCLUDED' => [ qr{^examples/}, diff --git a/cpan/Test-Harness/Changes b/cpan/Test-Harness/Changes index c926bbe..fea542e 100644 --- a/cpan/Test-Harness/Changes +++ b/cpan/Test-Harness/Changes @@ -1,5 +1,30 @@ Revision history for Test-Harness +3.24 2012-06-03 + - RT #74393: corrected typo in M::B integration docs. + - RT #63473: fix typo. + - RT #49732: Attempt to load File::Glob::Windows to get correct + glob semantics on Win32. + - RT #47890: Don't use Win32::GetShortPathName. + - RT #64404: Ignore textness ('-T') of script when reading shebang. + - Handle the case where we don't know the wait status of the + test more gracefully. + - Make the test summary 'ok' line overrideable so that it can be + changed to a plugin to make the output of prove idempotent. + - Apply upstream patch: + + http://perl5.git.perl.org/perl.git/commit \ + /6359c64336d99060952232e7e300bd3c31afead8 + + In testargs.t in Test::Harness, don't run a world-writable file. + + The test writes a file, then changes the mode, then executes it. The file needs + to be +x to be executable (on many platforms). The file will need to be +w to + be deletable on some platforms. But setting the file world writable just before + running it feels like a bad idea, given that the file's name is as predictable + as process IDs, as there's a race condition to break into the account running + perl's tests. + 3.23 2011-02-20 - Merge in changes from core. Thanks BinGOs. - Made SourceHandler understand that an executable binary file diff --git a/cpan/Test-Harness/MANIFEST b/cpan/Test-Harness/MANIFEST index ee35512..63b696b 100644 --- a/cpan/Test-Harness/MANIFEST +++ b/cpan/Test-Harness/MANIFEST @@ -76,6 +76,7 @@ t/aggregator.t t/bailout.t t/base.t t/callbacks.t +t/compat/env.opts.t t/compat/env.t t/compat/failure.t t/compat/inc-propagation.t @@ -125,6 +126,7 @@ t/multiplexer.t t/nested.t t/nofork-mux.t t/nofork.t +t/nowarn.t t/object.t t/parse.t t/parser-config.t @@ -232,3 +234,4 @@ xt/author/pod.t xt/author/stdin.t xt/perls/harness_perl.t xt/perls/sample-tests/perl_version +META.json diff --git a/cpan/Test-Harness/MANIFEST.CUMMULATIVE b/cpan/Test-Harness/MANIFEST.CUMMULATIVE index c0e58b0..bd2b6f0 100644 --- a/cpan/Test-Harness/MANIFEST.CUMMULATIVE +++ b/cpan/Test-Harness/MANIFEST.CUMMULATIVE @@ -156,6 +156,7 @@ t/compat/040-test-harness-compat.t t/compat/060-version.t t/compat/base.t t/compat/callback.t +t/compat/env.opts.t t/compat/env.t t/compat/failure.t t/compat/from_line.t @@ -220,6 +221,7 @@ t/multiplexer.t t/nested.t t/nofork-mux.t t/nofork.t +t/nowarn.t t/object.t t/parse.t t/parser-config.t diff --git a/cpan/Test-Harness/bin/prove b/cpan/Test-Harness/bin/prove index 7c2d5e6..e14ceba 100644 --- a/cpan/Test-Harness/bin/prove +++ b/cpan/Test-Harness/bin/prove @@ -144,7 +144,7 @@ If you need to make sure your diagnostics are displayed in the correct order relative to test results you can use the C<--merge> option to merge the test scripts' STDERR into their STDOUT. -This guarantees that STDOUT (where the test results appear) and STDOUT +This guarantees that STDOUT (where the test results appear) and STDERR (where the diagnostics appear) will stay in sync. The harness will display any diagnostics your tests emit on STDERR. diff --git a/cpan/Test-Harness/lib/App/Prove.pm b/cpan/Test-Harness/lib/App/Prove.pm index 0e74fb4..344cbb5 100644 --- a/cpan/Test-Harness/lib/App/Prove.pm +++ b/cpan/Test-Harness/lib/App/Prove.pm @@ -17,11 +17,11 @@ App::Prove - Implements the C<prove> command. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION @@ -218,6 +218,7 @@ sub process_args { 'D|dry' => \$self->{dry}, 'ext=s@' => sub { my ( $opt, $val ) = @_; + # Workaround for Getopt::Long 2.25 handling of # multivalue options push @{ $self->{extensions} ||= [] }, $val; diff --git a/cpan/Test-Harness/lib/App/Prove/State.pm b/cpan/Test-Harness/lib/App/Prove/State.pm index 91275b0..106fb5e 100644 --- a/cpan/Test-Harness/lib/App/Prove/State.pm +++ b/cpan/Test-Harness/lib/App/Prove/State.pm @@ -26,11 +26,11 @@ App::Prove::State - State storage for the C<prove> command. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION @@ -77,11 +77,12 @@ sub new { my %args = %{ shift || {} }; my $self = bless { - select => [], - seq => 1, - store => delete $args{store}, - extensions => ( delete $args{extensions} || ['.t'] ), - result_class => ( delete $args{result_class} || 'App::Prove::State::Result' ), + select => [], + seq => 1, + store => delete $args{store}, + extensions => ( delete $args{extensions} || ['.t'] ), + result_class => + ( delete $args{result_class} || 'App::Prove::State::Result' ), }, $class; $self->{_} = $self->result_class->new( @@ -216,48 +217,70 @@ sub apply_switch { my %handler = ( last => sub { $self->_select( + limit => shift, where => sub { $_->generation >= $last_gen }, order => sub { $_->sequence } ); }, failed => sub { $self->_select( + limit => shift, where => sub { $_->result != 0 }, order => sub { -$_->result } ); }, passed => sub { - $self->_select( where => sub { $_->result == 0 } ); + $self->_select( + limit => shift, + where => sub { $_->result == 0 } + ); }, all => sub { - $self->_select(); + $self->_select( limit => shift ); }, todo => sub { $self->_select( + limit => shift, where => sub { $_->num_todo != 0 }, order => sub { -$_->num_todo; } ); }, hot => sub { $self->_select( + limit => shift, where => sub { defined $_->last_fail_time }, order => sub { $now - $_->last_fail_time } ); }, slow => sub { - $self->_select( order => sub { -$_->elapsed } ); + $self->_select( + limit => shift, + order => sub { -$_->elapsed } + ); }, fast => sub { - $self->_select( order => sub { $_->elapsed } ); + $self->_select( + limit => shift, + order => sub { $_->elapsed } + ); }, new => sub { - $self->_select( order => sub { -$_->mtime } ); + $self->_select( + limit => shift, + order => sub { -$_->mtime } + ); }, old => sub { - $self->_select( order => sub { $_->mtime } ); + $self->_select( + limit => shift, + order => sub { $_->mtime } + ); }, fresh => sub { - $self->_select( where => sub { $_->mtime >= $last_run_time } ); + $self->_select( + limit => shift, + where => sub { $_->mtime >= $last_run_time } + ); }, save => sub { $self->{should_save}++; @@ -344,6 +367,10 @@ sub _query_clause { } @got; } + if ( my $limit = $clause->{limit} ) { + @got = splice @got, 0, $limit if @got > $limit; + } + return @got; } @@ -354,7 +381,10 @@ sub _get_raw_tests { my @tests; # Do globbing on Win32. - @argv = map { glob "$_" } @argv if NEED_GLOB; + if (NEED_GLOB) { + eval "use File::Glob::Windows"; # [49732] + @argv = map { glob "$_" } @argv; + } my $extensions = $self->{extensions}; for my $arg (@argv) { @@ -368,7 +398,8 @@ sub _get_raw_tests { sort -d $arg ? $recurse ? $self->_expand_dir_recursive( $arg, $extensions ) - : map { glob( File::Spec->catfile( $arg, "*$_" ) ) } @{$extensions} + : map { glob( File::Spec->catfile( $arg, "*$_" ) ) } + @{$extensions} : $arg; } return @tests; @@ -378,13 +409,13 @@ sub _expand_dir_recursive { my ( $self, $dir, $extensions ) = @_; my @tests; - my $ext_string = join( '|', map { quotemeta } @{$extensions} ); + my $ext_string = join( '|', map {quotemeta} @{$extensions} ); find( { follow => 1, #21938 follow_skip => 2, wanted => sub { - -f + -f && /(?:$ext_string)$/ && push @tests => $File::Find::name; } diff --git a/cpan/Test-Harness/lib/App/Prove/State/Result.pm b/cpan/Test-Harness/lib/App/Prove/State/Result.pm index 6fb3aa8..c0e64ff 100644 --- a/cpan/Test-Harness/lib/App/Prove/State/Result.pm +++ b/cpan/Test-Harness/lib/App/Prove/State/Result.pm @@ -14,11 +14,11 @@ App::Prove::State::Result - Individual test suite results. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION diff --git a/cpan/Test-Harness/lib/App/Prove/State/Result/Test.pm b/cpan/Test-Harness/lib/App/Prove/State/Result/Test.pm index 9aa3153..4146d23 100644 --- a/cpan/Test-Harness/lib/App/Prove/State/Result/Test.pm +++ b/cpan/Test-Harness/lib/App/Prove/State/Result/Test.pm @@ -10,11 +10,11 @@ App::Prove::State::Result::Test - Individual test results. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION diff --git a/cpan/Test-Harness/lib/TAP/Base.pm b/cpan/Test-Harness/lib/TAP/Base.pm index 9f91cad..33b3b3a 100644 --- a/cpan/Test-Harness/lib/TAP/Base.pm +++ b/cpan/Test-Harness/lib/TAP/Base.pm @@ -14,11 +14,11 @@ and L<TAP::Harness> =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; use constant GOT_TIME_HIRES => do { eval 'use Time::HiRes qw(time);'; diff --git a/cpan/Test-Harness/lib/TAP/Formatter/Base.pm b/cpan/Test-Harness/lib/TAP/Formatter/Base.pm index 678ea2f..72012a1 100644 --- a/cpan/Test-Harness/lib/TAP/Formatter/Base.pm +++ b/cpan/Test-Harness/lib/TAP/Formatter/Base.pm @@ -25,13 +25,27 @@ BEGIN { show_count => sub { shift; shift }, stdout => sub { my ( $self, $ref ) = @_; + $self->_croak("option 'stdout' needs a filehandle") - unless ( ref $ref || '' ) eq 'GLOB' - or eval { $ref->can('print') }; + unless $self->_is_filehandle($ref); + return $ref; }, ); + sub _is_filehandle { + my ( $self, $ref ) = @_; + + return 0 if !defined $ref; + + return 1 if ref $ref eq 'GLOB'; # lexical filehandle + return 1 if !ref $ref && ref \$ref eq 'GLOB'; # bare glob like *STDOUT + + return 1 if eval { $ref->can('print') }; + + return 0; + } + my @getter_setters = qw( _longest _printed_summary_header @@ -47,11 +61,11 @@ TAP::Formatter::Base - Base class for harness output delegates =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION @@ -375,9 +389,11 @@ sub _summary_test_header { my $spaces = ' ' x ( $self->_longest - length $test ); $spaces = ' ' unless $spaces; my $output = $self->_get_output_method($parser); + my $wait = $parser->wait; + defined $wait or $wait = '(none)'; $self->$output( - sprintf "$test$spaces(Wstat: %d Tests: %d Failed: %d)\n", - $parser->wait, $parser->tests_run, scalar $parser->failed + sprintf "$test$spaces(Wstat: %s Tests: %d Failed: %d)\n", + $wait, $parser->tests_run, scalar $parser->failed ); $self->_printed_summary_header(1); } diff --git a/cpan/Test-Harness/lib/TAP/Formatter/Color.pm b/cpan/Test-Harness/lib/TAP/Formatter/Color.pm index abf885b..1cf9fbd 100644 --- a/cpan/Test-Harness/lib/TAP/Formatter/Color.pm +++ b/cpan/Test-Harness/lib/TAP/Formatter/Color.pm @@ -71,11 +71,11 @@ TAP::Formatter::Color - Run Perl test scripts with color =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION diff --git a/cpan/Test-Harness/lib/TAP/Formatter/Console.pm b/cpan/Test-Harness/lib/TAP/Formatter/Console.pm index 8925e86..bd07154 100644 --- a/cpan/Test-Harness/lib/TAP/Formatter/Console.pm +++ b/cpan/Test-Harness/lib/TAP/Formatter/Console.pm @@ -14,11 +14,11 @@ TAP::Formatter::Console - Harness output delegate for default console output =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION diff --git a/cpan/Test-Harness/lib/TAP/Formatter/Console/ParallelSession.pm b/cpan/Test-Harness/lib/TAP/Formatter/Console/ParallelSession.pm index 1997564..7a94707 100644 --- a/cpan/Test-Harness/lib/TAP/Formatter/Console/ParallelSession.pm +++ b/cpan/Test-Harness/lib/TAP/Formatter/Console/ParallelSession.pm @@ -42,11 +42,11 @@ TAP::Formatter::Console::ParallelSession - Harness output delegate for parallel =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION diff --git a/cpan/Test-Harness/lib/TAP/Formatter/Console/Session.pm b/cpan/Test-Harness/lib/TAP/Formatter/Console/Session.pm index b9cdc08..ba6dbf7 100644 --- a/cpan/Test-Harness/lib/TAP/Formatter/Console/Session.pm +++ b/cpan/Test-Harness/lib/TAP/Formatter/Console/Session.pm @@ -28,11 +28,11 @@ TAP::Formatter::Console::Session - Harness output delegate for default console o =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION @@ -200,7 +200,7 @@ sub _closures { } } - $formatter->_output("ok$time_report\n"); + $formatter->_output( $self->_make_ok_line($time_report) ); } }, }; diff --git a/cpan/Test-Harness/lib/TAP/Formatter/File.pm b/cpan/Test-Harness/lib/TAP/Formatter/File.pm index aaad61b..84515e5 100644 --- a/cpan/Test-Harness/lib/TAP/Formatter/File.pm +++ b/cpan/Test-Harness/lib/TAP/Formatter/File.pm @@ -15,11 +15,11 @@ TAP::Formatter::File - Harness output delegate for file output =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION diff --git a/cpan/Test-Harness/lib/TAP/Formatter/File/Session.pm b/cpan/Test-Harness/lib/TAP/Formatter/File/Session.pm index e7d576e..95fb701 100644 --- a/cpan/Test-Harness/lib/TAP/Formatter/File/Session.pm +++ b/cpan/Test-Harness/lib/TAP/Formatter/File/Session.pm @@ -13,11 +13,11 @@ TAP::Formatter::File::Session - Harness output delegate for file output =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION @@ -103,7 +103,7 @@ sub close_test { $formatter->_output( $pretty . ( $self->{results} ? "\n" . $self->{results} : "" ) - . "ok$time_report\n" ); + . $self->_make_ok_line($time_report) ); } } diff --git a/cpan/Test-Harness/lib/TAP/Formatter/Session.pm b/cpan/Test-Harness/lib/TAP/Formatter/Session.pm index 5c0f57c..95d9277 100644 --- a/cpan/Test-Harness/lib/TAP/Formatter/Session.pm +++ b/cpan/Test-Harness/lib/TAP/Formatter/Session.pm @@ -25,11 +25,11 @@ TAP::Formatter::Session - Abstract base class for harness output delegate =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 METHODS @@ -180,4 +180,9 @@ sub _output_test_failure { $formatter->_output("\n"); } +sub _make_ok_line { + my ( $self, $suffix ) = @_; + return "ok$suffix\n"; +} + 1; diff --git a/cpan/Test-Harness/lib/TAP/Harness.pm b/cpan/Test-Harness/lib/TAP/Harness.pm index 2c663ae..e2b7aed 100644 --- a/cpan/Test-Harness/lib/TAP/Harness.pm +++ b/cpan/Test-Harness/lib/TAP/Harness.pm @@ -19,11 +19,11 @@ TAP::Harness - Run test scripts with statistics =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; $ENV{HARNESS_ACTIVE} = 1; $ENV{HARNESS_VERSION} = $VERSION; @@ -888,7 +888,7 @@ parameter to C<new>, typically from your C<Build.PL>. For example: extensions => ['.tap', '.txt'], }, }, - formatter => 'TAP::Formatter::HTML', + formatter_class => 'TAP::Formatter::HTML', }, build_requires => { 'Module::Build' => '0.30', diff --git a/cpan/Test-Harness/lib/TAP/Object.pm b/cpan/Test-Harness/lib/TAP/Object.pm index e933179..ddba15a 100644 --- a/cpan/Test-Harness/lib/TAP/Object.pm +++ b/cpan/Test-Harness/lib/TAP/Object.pm @@ -9,11 +9,11 @@ TAP::Object - Base class that provides common functionality to all C<TAP::*> mod =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser.pm b/cpan/Test-Harness/lib/TAP/Parser.pm index 55edb0d..a175201 100644 --- a/cpan/Test-Harness/lib/TAP/Parser.pm +++ b/cpan/Test-Harness/lib/TAP/Parser.pm @@ -24,11 +24,11 @@ TAP::Parser - Parse L<TAP|Test::Harness::TAP> output =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; my $DEFAULT_TAP_VERSION = 12; my $MAX_TAP_VERSION = 13; @@ -1884,7 +1884,7 @@ progress on your bug as we make changes. Obviously, bugs which include patches are best. If you prefer, you can patch against bleed by via anonymous checkout of the latest version: - git clone git://github.com/AndyA/Test-Harness.git + git clone git://github.com/Perl-Toolchain-Gang/Test-Harness.git =head1 COPYRIGHT & LICENSE diff --git a/cpan/Test-Harness/lib/TAP/Parser/Aggregator.pm b/cpan/Test-Harness/lib/TAP/Parser/Aggregator.pm index 822b0d7..9cc0103 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Aggregator.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Aggregator.pm @@ -14,11 +14,11 @@ TAP::Parser::Aggregator - Aggregate TAP::Parser results =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/Grammar.pm b/cpan/Test-Harness/lib/TAP/Parser/Grammar.pm index 0646d15..4a2bb4a 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Grammar.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Grammar.pm @@ -15,11 +15,11 @@ TAP::Parser::Grammar - A grammar for the Test Anything Protocol. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/Iterator.pm b/cpan/Test-Harness/lib/TAP/Parser/Iterator.pm index dd83199..dbfd406 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Iterator.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Iterator.pm @@ -13,11 +13,11 @@ TAP::Parser::Iterator - Base class for TAP source iterators =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/Iterator/Array.pm b/cpan/Test-Harness/lib/TAP/Parser/Iterator/Array.pm index 4a19584..e107ee3 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Iterator/Array.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Iterator/Array.pm @@ -13,11 +13,11 @@ TAP::Parser::Iterator::Array - Iterator for array-based TAP sources =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/Iterator/Process.pm b/cpan/Test-Harness/lib/TAP/Parser/Iterator/Process.pm index f4332c9..0535715 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Iterator/Process.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Iterator/Process.pm @@ -17,11 +17,11 @@ TAP::Parser::Iterator::Process - Iterator for process-based TAP sources =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/Iterator/Stream.pm b/cpan/Test-Harness/lib/TAP/Parser/Iterator/Stream.pm index 27d87fb..481630d 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Iterator/Stream.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Iterator/Stream.pm @@ -13,11 +13,11 @@ TAP::Parser::Iterator::Stream - Iterator for filehandle-based TAP sources =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/IteratorFactory.pm b/cpan/Test-Harness/lib/TAP/Parser/IteratorFactory.pm index a45f085..37a81cb 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/IteratorFactory.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/IteratorFactory.pm @@ -18,11 +18,11 @@ TAP::Parser::IteratorFactory - Figures out which SourceHandler objects to use fo =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/Multiplexer.pm b/cpan/Test-Harness/lib/TAP/Parser/Multiplexer.pm index 934933c..3cf02c1 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Multiplexer.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Multiplexer.pm @@ -18,11 +18,11 @@ TAP::Parser::Multiplexer - Multiplex multiple TAP::Parsers =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/Result.pm b/cpan/Test-Harness/lib/TAP/Parser/Result.pm index c812030..6f5d5da 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Result.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Result.pm @@ -26,11 +26,11 @@ TAP::Parser::Result - Base class for TAP::Parser output objects =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/Result/Bailout.pm b/cpan/Test-Harness/lib/TAP/Parser/Result/Bailout.pm index e85d2a9..6bf8498 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Result/Bailout.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Result/Bailout.pm @@ -12,11 +12,11 @@ TAP::Parser::Result::Bailout - Bailout result token. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION diff --git a/cpan/Test-Harness/lib/TAP/Parser/Result/Comment.pm b/cpan/Test-Harness/lib/TAP/Parser/Result/Comment.pm index 239a3eb..394f192 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Result/Comment.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Result/Comment.pm @@ -12,11 +12,11 @@ TAP::Parser::Result::Comment - Comment result token. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION diff --git a/cpan/Test-Harness/lib/TAP/Parser/Result/Plan.pm b/cpan/Test-Harness/lib/TAP/Parser/Result/Plan.pm index 56ac06a..19f466b 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Result/Plan.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Result/Plan.pm @@ -12,11 +12,11 @@ TAP::Parser::Result::Plan - Plan result token. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION diff --git a/cpan/Test-Harness/lib/TAP/Parser/Result/Pragma.pm b/cpan/Test-Harness/lib/TAP/Parser/Result/Pragma.pm index b2a9709..21e8734 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Result/Pragma.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Result/Pragma.pm @@ -12,11 +12,11 @@ TAP::Parser::Result::Pragma - TAP pragma token. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION diff --git a/cpan/Test-Harness/lib/TAP/Parser/Result/Test.pm b/cpan/Test-Harness/lib/TAP/Parser/Result/Test.pm index dd1ecd2..b436965 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Result/Test.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Result/Test.pm @@ -14,11 +14,11 @@ TAP::Parser::Result::Test - Test result token. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION diff --git a/cpan/Test-Harness/lib/TAP/Parser/Result/Unknown.pm b/cpan/Test-Harness/lib/TAP/Parser/Result/Unknown.pm index 861de5e..b736e8b 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Result/Unknown.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Result/Unknown.pm @@ -14,11 +14,11 @@ TAP::Parser::Result::Unknown - Unknown result token. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION diff --git a/cpan/Test-Harness/lib/TAP/Parser/Result/Version.pm b/cpan/Test-Harness/lib/TAP/Parser/Result/Version.pm index f20c7a1..98c0dd6 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Result/Version.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Result/Version.pm @@ -12,11 +12,11 @@ TAP::Parser::Result::Version - TAP syntax version token. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION diff --git a/cpan/Test-Harness/lib/TAP/Parser/Result/YAML.pm b/cpan/Test-Harness/lib/TAP/Parser/Result/YAML.pm index 28aae77..3417cd1 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Result/YAML.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Result/YAML.pm @@ -12,11 +12,11 @@ TAP::Parser::Result::YAML - YAML result token. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 DESCRIPTION diff --git a/cpan/Test-Harness/lib/TAP/Parser/ResultFactory.pm b/cpan/Test-Harness/lib/TAP/Parser/ResultFactory.pm index 37ec96b..9cda5f6 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/ResultFactory.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/ResultFactory.pm @@ -30,11 +30,11 @@ TAP::Parser::ResultFactory - Factory for creating TAP::Parser output objects =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head2 DESCRIPTION diff --git a/cpan/Test-Harness/lib/TAP/Parser/Scheduler.pm b/cpan/Test-Harness/lib/TAP/Parser/Scheduler.pm index 5221941..12ccc4f 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Scheduler.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Scheduler.pm @@ -12,11 +12,11 @@ TAP::Parser::Scheduler - Schedule tests during parallel testing =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/Scheduler/Job.pm b/cpan/Test-Harness/lib/TAP/Parser/Scheduler/Job.pm index 18c1026..db21cf5 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Scheduler/Job.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Scheduler/Job.pm @@ -10,11 +10,11 @@ TAP::Parser::Scheduler::Job - A single testing job. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/Scheduler/Spinner.pm b/cpan/Test-Harness/lib/TAP/Parser/Scheduler/Spinner.pm index eb88b44..b1b6fc7 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Scheduler/Spinner.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Scheduler/Spinner.pm @@ -10,11 +10,11 @@ TAP::Parser::Scheduler::Spinner - A no-op job. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/Source.pm b/cpan/Test-Harness/lib/TAP/Parser/Source.pm index a33fe6f..7a7bca3 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Source.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Source.pm @@ -6,6 +6,8 @@ use vars qw($VERSION @ISA); use TAP::Object (); use File::Basename qw( fileparse ); +use constant BLK_SIZE => 512; + @ISA = qw(TAP::Object); =head1 NAME @@ -14,11 +16,11 @@ TAP::Parser::Source - a TAP source & meta data about it =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS @@ -288,8 +290,8 @@ sub assemble_meta { $file->{lc_ext} = lc( $file->{ext} ); $file->{basename} .= $file->{ext} if $file->{ext}; - if ( $file->{text} and $file->{read} ) { - eval { $file->{shebang} = $self->_read_shebang($$raw); }; + if ( !$file->{is_dir} && $file->{read} ) { + eval { $file->{shebang} = $self->shebang($$raw); }; if ( my $e = $@ ) { warn $e; } @@ -323,18 +325,14 @@ May be called as a class method my %shebang_for; sub _read_shebang { - my ( $self, $file ) = @_; - my $shebang; - local *TEST; - if ( open( TEST, $file ) ) { - $shebang = <TEST>; - chomp $shebang; - close(TEST) or die "Can't close $file. $!\n"; - } - else { - die "Can't open $file. $!\n"; - } - return $shebang; + my ( $class, $file ) = @_; + open my $fh, '<', $file or die "Can't read $file: $!\n"; + + # Might be a binary file - so read a fixed number of bytes. + my $got = read $fh, my $buf, BLK_SIZE; + defined $got or die "I/O error: $!\n"; + return $1 if $buf =~ /(.*)/; + return; } sub shebang { diff --git a/cpan/Test-Harness/lib/TAP/Parser/SourceHandler.pm b/cpan/Test-Harness/lib/TAP/Parser/SourceHandler.pm index acacb0b..3fa18a7 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/SourceHandler.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/SourceHandler.pm @@ -14,11 +14,11 @@ TAP::Parser::SourceHandler - Base class for different TAP source handlers =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Executable.pm b/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Executable.pm index 8537ba1..cc464e0 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Executable.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Executable.pm @@ -17,11 +17,11 @@ TAP::Parser::SourceHandler::Executable - Stream output from an executable TAP so =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/File.pm b/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/File.pm index ab08eb2..7db5a3a 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/File.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/File.pm @@ -17,11 +17,11 @@ TAP::Parser::SourceHandler::File - Stream TAP from a text file. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Handle.pm b/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Handle.pm index fc2e654..17a9059 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Handle.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Handle.pm @@ -17,11 +17,11 @@ TAP::Parser::SourceHandler::Handle - Stream TAP from an IO::Handle or a GLOB. =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Perl.pm b/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Perl.pm index 9721acf..ae0857d 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Perl.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Perl.pm @@ -22,11 +22,11 @@ TAP::Parser::SourceHandler::Perl - Stream TAP from a Perl executable =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS @@ -80,6 +80,7 @@ sub can_handle { if ( my $shebang = $file->{shebang} ) { return 0.9 if $shebang =~ /^#!.*\bperl/; + # We favour Perl as the interpreter for any shebang to preserve # previous semantics: we used to execute everything via Perl and # relied on it to pass the shebang off to the appropriate @@ -315,7 +316,7 @@ Gets the version of Perl currently running the test suite. sub get_perl { my $class = shift; return $ENV{HARNESS_PERL} if defined $ENV{HARNESS_PERL}; - return Win32::GetShortPathName($^X) if IS_WIN32; + return qq["$^X"] if IS_WIN32 && ( $^X =~ /[^\w\.\/\\]/ ); return $^X; } diff --git a/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/RawTAP.pm b/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/RawTAP.pm index 0d7a485..9c6274c 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/RawTAP.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/RawTAP.pm @@ -17,11 +17,11 @@ TAP::Parser::SourceHandler::RawTAP - Stream output from raw TAP in a scalar/arra =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/Utils.pm b/cpan/Test-Harness/lib/TAP/Parser/Utils.pm index 49a457a..db12bf1 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/Utils.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/Utils.pm @@ -13,11 +13,11 @@ TAP::Parser::Utils - Internal TAP::Parser utilities =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/YAMLish/Reader.pm b/cpan/Test-Harness/lib/TAP/Parser/YAMLish/Reader.pm index 82968b4..2607251 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/YAMLish/Reader.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/YAMLish/Reader.pm @@ -6,7 +6,7 @@ use vars qw($VERSION @ISA); use TAP::Object (); @ISA = 'TAP::Object'; -$VERSION = '3.23'; +$VERSION = '3.24'; # TODO: # Handle blessed object syntax @@ -270,7 +270,7 @@ TAP::Parser::YAMLish::Reader - Read YAMLish data from iterator =head1 VERSION -Version 3.23 +Version 3.24 =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/TAP/Parser/YAMLish/Writer.pm b/cpan/Test-Harness/lib/TAP/Parser/YAMLish/Writer.pm index dda5f18..e6bd5ee 100644 --- a/cpan/Test-Harness/lib/TAP/Parser/YAMLish/Writer.pm +++ b/cpan/Test-Harness/lib/TAP/Parser/YAMLish/Writer.pm @@ -6,7 +6,7 @@ use vars qw($VERSION @ISA); use TAP::Object (); @ISA = 'TAP::Object'; -$VERSION = '3.23'; +$VERSION = '3.24'; my $ESCAPE_CHAR = qr{ [ \x00-\x1f \" ] }x; my $ESCAPE_KEY = qr{ (?: ^\W ) | $ESCAPE_CHAR }x; @@ -147,7 +147,7 @@ TAP::Parser::YAMLish::Writer - Write YAMLish data =head1 VERSION -Version 3.23 +Version 3.24 =head1 SYNOPSIS diff --git a/cpan/Test-Harness/lib/Test/Harness.pm b/cpan/Test-Harness/lib/Test/Harness.pm index 53bc92a..b93678e 100644 --- a/cpan/Test-Harness/lib/Test/Harness.pm +++ b/cpan/Test-Harness/lib/Test/Harness.pm @@ -46,11 +46,11 @@ Test::Harness - Run Perl standard test scripts with statistics =head1 VERSION -Version 3.23 +Version 3.24 =cut -$VERSION = '3.23'; +$VERSION = '3.24'; # Backwards compatibility for exportable variable names. *verbose = *Verbose; @@ -73,7 +73,7 @@ END { $Verbose = $ENV{HARNESS_VERBOSE} || 0; $Debug = $ENV{HARNESS_DEBUG} || 0; -$Switches = '-w'; +$Switches = ''; $Columns = $ENV{HARNESS_COLUMNS} || $ENV{COLUMNS} || 80; $Columns--; # Some shells have trouble with a full line of text. $Timer = $ENV{HARNESS_TIMER} || 0; @@ -238,6 +238,7 @@ sub _new_harness { $args->{stdout} = $sub_args->{out} if exists $sub_args->{out}; + my $class = $ENV{HARNESS_SUBCLASS} || 'TAP::Harness'; if ( defined( my $env_opt = $ENV{HARNESS_OPTIONS} ) ) { for my $opt ( split /:/, $env_opt ) { if ( $opt =~ /^j(\d*)$/ ) { @@ -246,13 +247,22 @@ sub _new_harness { elsif ( $opt eq 'c' ) { $args->{color} = 1; } + elsif ( $opt =~ m/^f(.*)$/ ) { + my $fmt = $1; + $fmt =~ s/-/::/g; + $args->{formatter_class} = $fmt; + } + elsif ( $opt =~ m/^a(.*)$/ ) { + my $archive = $1; + $class = "TAP::Harness::Archive"; + $args->{archive} = $archive; + } else { die "Unknown HARNESS_OPTIONS item: $opt\n"; } } } - my $class = $ENV{HARNESS_SUBCLASS} || 'TAP::Harness'; return TAP::Harness->_construct( $class, $args ); } @@ -535,6 +545,16 @@ Run <n> (default 9) parallel jobs. Try to color output. See L<TAP::Formatter::Base/"new">. +=item C<< a<file.tgz> >> + +Will use L<TAP::Harness::Archive> as the harness class, and save the TAP to +C<file.tgz> + +=item C<< fPackage-With-Dashes >> + +Set the formatter_class of the harness being run. Since the C<HARNESS_OPTIONS> +is seperated by C<:>, we use C<-> instead. + =back Multiple options may be separated by colons: diff --git a/cpan/Test-Harness/t/compat/env.opts.t b/cpan/Test-Harness/t/compat/env.opts.t new file mode 100644 index 0000000..c28f4c2 --- /dev/null +++ b/cpan/Test-Harness/t/compat/env.opts.t @@ -0,0 +1,56 @@ +#!/usr/bin/perl -w + +use strict; +use Test::More ( + $^O eq 'VMS' + ? ( skip_all => 'VMS' ) + : ( tests => 12 ) +); + +use Test::Harness; + +sub _has_module { + my $module = shift; + eval "use $module"; + return $@ ? 0 : 1; +} + +{ + + # Should add a fake home dir? to test the rc stuff.. + local $ENV{HARNESS_OPTIONS} = 'j4:c'; + + ok my $harness = Test::Harness::_new_harness, 'made harness'; + is( $harness->color, 1, "set color correctly" ); + is( $harness->jobs, 4, "set jobs correctly" ); +} +SKIP: { + skip "requires TAP::Formatter::HTML", 4 + unless _has_module('TAP::Formatter::HTML'); + + local $ENV{HARNESS_OPTIONS} = 'j4:c:fTAP-Formatter-HTML'; + + ok my $harness = Test::Harness::_new_harness, 'made harness'; + is( $harness->color, 1, "set color correctly" ); + is( $harness->jobs, 4, "set jobs correctly" ); + is( $harness->formatter_class, "TAP::Formatter::HTML", + "correct formatter" ); + +} +SKIP: { + skip "requires TAP::Harness::Archive", 5 + unless _has_module('TAP::Harness::Archive'); + + # Test archive + local $ENV{HARNESS_OPTIONS} = 'j4:c:a/archive.tgz'; + + ok my $harness = Test::Harness::_new_harness, 'made harness'; + is( $harness->color, 1, "set color correctly" ); + is( $harness->jobs, 4, "set jobs correctly" ); + isa_ok( $harness, "TAP::Harness::Archive", "correct harness subclass" ); + + # XXX: this is nasty :( + is( $harness->{__archive_file}, "/archive.tgz", "correct archive found" ); + +} + diff --git a/cpan/Test-Harness/t/harness.t b/cpan/Test-Harness/t/harness.t index a5f0c47..774f49b5 100644 --- a/cpan/Test-Harness/t/harness.t +++ b/cpan/Test-Harness/t/harness.t @@ -16,7 +16,7 @@ my $HARNESS = 'TAP::Harness'; my $source_tests = 't/source_tests'; my $sample_tests = 't/sample-tests'; -plan tests => 128; +plan tests => 132; # note that this test will always pass when run through 'prove' ok $ENV{HARNESS_ACTIVE}, 'HARNESS_ACTIVE env variable should be set'; @@ -876,57 +876,86 @@ sub _runtests { # coverage tests for the stdout key of VALIDATON_FOR, used by _initialize() in the ctor - # the coverage tests are - # 1. ref $ref => false - # 2. ref => ! GLOB and ref->can(print) - # 3. ref $ref => GLOB + { - # case 1 + # ref $ref => false + my @die; - my @die; + eval { + local $SIG{__DIE__} = sub { push @die, @_ }; - eval { - local $SIG{__DIE__} = sub { push @die, @_ }; + my $harness = TAP::Harness->new( + { stdout => bless {}, '0', # how evil is THAT !!! + } + ); + }; + + is @die, 1, 'bad filehandle to stdout'; + like pop @die, qr/option 'stdout' needs a filehandle/, + '... and we died as expected'; + } + + { + + # ref => ! GLOB and ref->can(print) + + package Printable; + + sub new { return bless {}, shift } + + sub print {return} + + package main; my $harness = TAP::Harness->new( - { stdout => bless {}, '0', # how evil is THAT !!! + { stdout => Printable->new(), } ); - }; - is @die, 1, 'bad filehandle to stdout'; - like pop @die, qr/option 'stdout' needs a filehandle/, - '... and we died as expected'; + isa_ok $harness, 'TAP::Harness'; + } + + { - # case 2 + # ref $ref => GLOB - @die = (); + my $harness = TAP::Harness->new( + { stdout => bless {}, 'GLOB', # again with the evil + } + ); - package Printable; + isa_ok $harness, 'TAP::Harness'; + } - sub new { return bless {}, shift } + { - sub print {return} + # bare glob - package main; + my $harness = TAP::Harness->new( { stdout => *STDOUT } ); - my $harness = TAP::Harness->new( - { stdout => Printable->new(), - } - ); + isa_ok $harness, 'TAP::Harness'; + } - isa_ok $harness, 'TAP::Harness'; + { - # case 3 + # string filehandle - @die = (); + my $string = ''; + open my $fh, ">", \$string or die $!; + my $harness = TAP::Harness->new( { stdout => $fh } ); - $harness = TAP::Harness->new( - { stdout => bless {}, 'GLOB', # again with the evil - } - ); + isa_ok $harness, 'TAP::Harness'; + } - isa_ok $harness, 'TAP::Harness'; + { + + # lexical filehandle reference + + my $string = ''; + open my $fh, ">", \$string or die $!; + ok !eval { TAP::Harness->new( { stdout => \$fh } ); }; + like $@, qr/^option 'stdout' needs a filehandle /; + } } { diff --git a/cpan/Test-Harness/t/nowarn.t b/cpan/Test-Harness/t/nowarn.t new file mode 100644 index 0000000..5b6809f --- /dev/null +++ b/cpan/Test-Harness/t/nowarn.t @@ -0,0 +1,10 @@ +#!perl + +use Test::More tests => 1; + +# Make sure that warnings are only enabled if we enable them +# specifically. +ok !$^W, 'warnings disabled'; + +# vim:ts=2:sw=2:et:ft=perl + diff --git a/cpan/Test-Harness/t/prove.t b/cpan/Test-Harness/t/prove.t index 16a36da..429aabc 100644 --- a/cpan/Test-Harness/t/prove.t +++ b/cpan/Test-Harness/t/prove.t @@ -1086,10 +1086,10 @@ BEGIN { # START PLAN }, # Specify an oddball extension - { name => 'Switch --ext=.wango', - switches => [ '--ext=.wango' ], - expect => { extensions => ['.wango'] }, - runlog => [ + { name => 'Switch --ext=.wango', + switches => ['--ext=.wango'], + expect => { extensions => ['.wango'] }, + runlog => [ [ '_runtests', { verbosity => 0, show_count => 1, @@ -1100,10 +1100,10 @@ BEGIN { # START PLAN }, # Handle multiple extensions - { name => 'Switch --ext=.foo --ext=.bar', + { name => 'Switch --ext=.foo --ext=.bar', switches => [ '--ext=.foo', '--ext=.bar', ], - expect => { extensions => ['.foo','.bar'] }, - runlog => [ + expect => { extensions => [ '.foo', '.bar' ] }, + runlog => [ [ '_runtests', { verbosity => 0, show_count => 1, @@ -1157,10 +1157,10 @@ BEGIN { # START PLAN sources => { Perl => { foo => 'bar baz', avg => 0.278 }, MyCustom => {}, - File => { + File => { extensions => [ '.txt', '.tmp' ], - hash => { this => 'that', foo => 'bar'}, - sep => 'foo=bar', + hash => { this => 'that', foo => 'bar' }, + sep => 'foo=bar', }, }, }, @@ -1169,10 +1169,10 @@ BEGIN { # START PLAN { sources => { Perl => { foo => 'bar baz', avg => 0.278 }, MyCustom => {}, - File => { + File => { extensions => [ '.txt', '.tmp' ], - hash => { this => 'that', foo => 'bar'}, - sep => 'foo=bar', + hash => { this => 'that', foo => 'bar' }, + sep => 'foo=bar', }, }, verbosity => 0, diff --git a/cpan/Test-Harness/t/source.t b/cpan/Test-Harness/t/source.t index 92bf4a1..cdfd9e5 100644 --- a/cpan/Test-Harness/t/source.t +++ b/cpan/Test-Harness/t/source.t @@ -170,10 +170,11 @@ sub ct($) { is_dir => 0, is_file => 1, is_symlink => 0, + # Fix for bizarre -k bug in Strawberry Perl - sticky => ( -k $test )[-1] ? 1 : 0, - setgid => -g $test ? 1 : 0, - setuid => -u $test ? 1 : 0, + sticky => ( -k $test )[-1] ? 1 : 0, + setgid => -g $test ? 1 : 0, + setuid => -u $test ? 1 : 0, }, '... file->* set' ); diff --git a/cpan/Test-Harness/t/source_handler.t b/cpan/Test-Harness/t/source_handler.t index 77f675b..4c9e70d 100644 --- a/cpan/Test-Harness/t/source_handler.t +++ b/cpan/Test-Harness/t/source_handler.t @@ -28,7 +28,7 @@ my $perl = $^X; my %file = map { $_ => File::Spec->catfile( $dir, $_ ) } qw( source source.1 source.bat source.pl source.sh source_args.sh source.t - source.tap ); + source.tap ); # Abstract base class tests { @@ -110,7 +110,7 @@ my %file = map { $_ => File::Spec->catfile( $dir, $_ ) } }, { name => $file{'source_args.sh'}, raw => { exec => [ $file{'source_args.sh'} ] }, - test_args => [ 'foo' ], + test_args => ['foo'], skip => $HAS_SH && $HAS_ECHO ? 0 : 1, skip_reason => 'no /bin/sh, /bin/echo', iclass => 'TAP::Parser::Iterator::Process', @@ -357,11 +357,11 @@ sub test_handler { skip $test->{skip_reason}, $planned if $test->{skip}; my $source = TAP::Parser::Source->new; - $source->raw( $test->{raw} ) if $test->{raw}; + $source->raw( $test->{raw} ) if $test->{raw}; $source->test_args( $test->{test_args} ) if $test->{test_args}; - $source->meta( $test->{meta} ) if $test->{meta}; - $source->config( $test->{config} ) if $test->{config}; - $source->assemble_meta if $test->{assemble_meta}; + $source->meta( $test->{meta} ) if $test->{meta}; + $source->config( $test->{config} ) if $test->{config}; + $source->assemble_meta if $test->{assemble_meta}; my $iterator = eval { $class->make_iterator($source) }; my $e = $@; diff --git a/t/porting/customized.dat b/t/porting/customized.dat index f962044..4b705cf 100644 --- a/t/porting/customized.dat +++ b/t/porting/customized.dat @@ -1,5 +1,5 @@ Module::Build cpan/Module-Build/lib/Module/Build/ConfigData.pm 2f3f07fd889077ebd51791ad6e195d9164b4baf3 -Test::Harness cpan/Test-Harness/t/source.t 61738913dac9ba6c4504756d355c23c25c47d31e +Test::Harness cpan/Test-Harness/t/source.t 884890970fb850874213159df263ba483bac62e9 Test::Harness cpan/Test-Harness/t/testargs.t 79c91b2ea73f7cbfb9bae45dec4a62db74cb8dbf Module::Pluggable cpan/Module-Pluggable/Makefile.PL 72062c1a01ed7c62d16c55122c163b2d89f0d739 autodie cpan/autodie/t/open.t cb493da4305f591ca0344d09e8a840a3147c5579 -- Perl5 Master Repository
