summaryrefslogtreecommitdiff
path: root/cpan
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2012-06-03 21:35:21 +0100
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2012-06-15 14:33:49 +0100
commitf0e2c26d70215a4a0a92d68b00b7f33cba3104a6 (patch)
tree360e0775f5bac8a113d7c2383d31a35ab01fd7fc /cpan
parent2dde78c805d5b8715c7194600056f758aa51f982 (diff)
downloadperl-f0e2c26d70215a4a0a92d68b00b7f33cba3104a6.tar.gz
Updated Test-Harness to CPAN version 3.25
[DELTA] 3.25 2012-06-05 - Rereleased to fix CPAN permission problem. No functional change. 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.
Diffstat (limited to 'cpan')
-rw-r--r--cpan/Test-Harness/Changes28
-rw-r--r--cpan/Test-Harness/MANIFEST3
-rw-r--r--cpan/Test-Harness/MANIFEST.CUMMULATIVE2
-rw-r--r--cpan/Test-Harness/bin/prove2
-rw-r--r--cpan/Test-Harness/lib/App/Prove.pm5
-rw-r--r--cpan/Test-Harness/lib/App/Prove/State.pm67
-rw-r--r--cpan/Test-Harness/lib/App/Prove/State/Result.pm4
-rw-r--r--cpan/Test-Harness/lib/App/Prove/State/Result/Test.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Base.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Formatter/Base.pm28
-rw-r--r--cpan/Test-Harness/lib/TAP/Formatter/Color.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Formatter/Console.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Formatter/Console/ParallelSession.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Formatter/Console/Session.pm6
-rw-r--r--cpan/Test-Harness/lib/TAP/Formatter/File.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Formatter/File/Session.pm6
-rw-r--r--cpan/Test-Harness/lib/TAP/Formatter/Session.pm9
-rw-r--r--cpan/Test-Harness/lib/TAP/Harness.pm6
-rw-r--r--cpan/Test-Harness/lib/TAP/Object.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser.pm6
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Aggregator.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Grammar.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Iterator.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Iterator/Array.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Iterator/Process.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Iterator/Stream.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/IteratorFactory.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Multiplexer.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Result.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Result/Bailout.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Result/Comment.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Result/Plan.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Result/Pragma.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Result/Test.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Result/Unknown.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Result/Version.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Result/YAML.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/ResultFactory.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Scheduler.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Scheduler/Job.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Scheduler/Spinner.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Source.pm30
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/SourceHandler.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Executable.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/SourceHandler/File.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Handle.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Perl.pm7
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/SourceHandler/RawTAP.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/Utils.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/YAMLish/Reader.pm4
-rw-r--r--cpan/Test-Harness/lib/TAP/Parser/YAMLish/Writer.pm4
-rw-r--r--cpan/Test-Harness/lib/Test/Harness.pm28
-rw-r--r--cpan/Test-Harness/t/compat/env.opts.t56
-rw-r--r--cpan/Test-Harness/t/harness.t93
-rw-r--r--cpan/Test-Harness/t/nowarn.t10
-rw-r--r--cpan/Test-Harness/t/prove.t26
-rw-r--r--cpan/Test-Harness/t/source.t7
-rw-r--r--cpan/Test-Harness/t/source_handler.t12
58 files changed, 393 insertions, 192 deletions
diff --git a/cpan/Test-Harness/Changes b/cpan/Test-Harness/Changes
index c926bbe178..98629aa733 100644
--- a/cpan/Test-Harness/Changes
+++ b/cpan/Test-Harness/Changes
@@ -1,5 +1,33 @@
Revision history for Test-Harness
+3.25 2012-06-05
+ - Rereleased to fix CPAN permission problem. No functional change.
+
+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 ee35512034..63b696bd23 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 c0e58b0436..bd2b6f0314 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 7c2d5e6b1b..e14ceba177 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 0e74fb4cac..93778758a5 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 91275b0cdd..ea5ce7d532 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 6fb3aa8a09..45b1bdec5f 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 9aa3153a36..ad9d96ae2d 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=head1 DESCRIPTION
diff --git a/cpan/Test-Harness/lib/TAP/Base.pm b/cpan/Test-Harness/lib/TAP/Base.pm
index 9f91cad066..d359339928 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
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 678ea2f0e3..421dc44f0c 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 abf885b0f9..4934ad6fe3 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=head1 DESCRIPTION
diff --git a/cpan/Test-Harness/lib/TAP/Formatter/Console.pm b/cpan/Test-Harness/lib/TAP/Formatter/Console.pm
index 8925e86473..b99c4139a3 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 1997564ade..876dd0a8a8 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 b9cdc08eb0..7d21217320 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 aaad61b06b..1a2f49bb61 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 e7d576ef90..3ca0c5c3cc 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 5c0f57cca2..8d96e777b7 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 2c663ae020..79a0f877a7 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
$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 e933179c91..42e3acb8c0 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=head1 SYNOPSIS
diff --git a/cpan/Test-Harness/lib/TAP/Parser.pm b/cpan/Test-Harness/lib/TAP/Parser.pm
index 55edb0dbd8..1ed26175bd 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
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 822b0d7109..47b6bfd514 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=head1 SYNOPSIS
diff --git a/cpan/Test-Harness/lib/TAP/Parser/Grammar.pm b/cpan/Test-Harness/lib/TAP/Parser/Grammar.pm
index 0646d15d29..4aee443907 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=head1 SYNOPSIS
diff --git a/cpan/Test-Harness/lib/TAP/Parser/Iterator.pm b/cpan/Test-Harness/lib/TAP/Parser/Iterator.pm
index dd831995dc..e4b3e72db1 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 4a195849bc..8145a62b1b 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 f4332c9450..c41a4475ce 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 27d87fb996..8c22fc01e4 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=head1 SYNOPSIS
diff --git a/cpan/Test-Harness/lib/TAP/Parser/IteratorFactory.pm b/cpan/Test-Harness/lib/TAP/Parser/IteratorFactory.pm
index a45f08550c..ad66167ed5 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=head1 SYNOPSIS
diff --git a/cpan/Test-Harness/lib/TAP/Parser/Multiplexer.pm b/cpan/Test-Harness/lib/TAP/Parser/Multiplexer.pm
index 934933cae3..f99385428c 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=head1 SYNOPSIS
diff --git a/cpan/Test-Harness/lib/TAP/Parser/Result.pm b/cpan/Test-Harness/lib/TAP/Parser/Result.pm
index c8120302f3..c2ea1d36d9 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 e85d2a9a95..12c1aa9070 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 239a3eb22b..9ab776441f 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 56ac06ac4e..4659c1c2da 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 b2a9709c33..3f98e138ca 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 dd1ecd2edf..5510c0a8a1 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 861de5e29f..fe422ac836 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 f20c7a1d0a..72d6fff651 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 28aae77a10..63e592f6b6 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=head1 DESCRIPTION
diff --git a/cpan/Test-Harness/lib/TAP/Parser/ResultFactory.pm b/cpan/Test-Harness/lib/TAP/Parser/ResultFactory.pm
index 37ec96b201..616ffad106 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=head2 DESCRIPTION
diff --git a/cpan/Test-Harness/lib/TAP/Parser/Scheduler.pm b/cpan/Test-Harness/lib/TAP/Parser/Scheduler.pm
index 522194182b..34cec5abbb 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 18c1026a9d..6d45f7d5b5 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 eb88b44401..6906a675c2 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=head1 SYNOPSIS
diff --git a/cpan/Test-Harness/lib/TAP/Parser/Source.pm b/cpan/Test-Harness/lib/TAP/Parser/Source.pm
index a33fe6fdb6..82345690c4 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 acacb0b417..606dcf2bbc 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 8537ba18bf..eff7bb832e 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 ab08eb2922..3ac03cb5f7 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 fc2e65461c..5773b005f4 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 9721acf9f1..b3eb2222c8 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 0d7a4851ee..6f20ab042f 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=head1 SYNOPSIS
diff --git a/cpan/Test-Harness/lib/TAP/Parser/Utils.pm b/cpan/Test-Harness/lib/TAP/Parser/Utils.pm
index 49a457a378..a199d4a591 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
=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 82968b42b1..8f4768a141 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.25';
# 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.25
=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 dda5f1873e..d04cb96df3 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.25';
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.25
=head1 SYNOPSIS
diff --git a/cpan/Test-Harness/lib/Test/Harness.pm b/cpan/Test-Harness/lib/Test/Harness.pm
index 53bc92a741..4c0bc953b5 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.25
=cut
-$VERSION = '3.23';
+$VERSION = '3.25';
# 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 0000000000..c28f4c2806
--- /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 a5f0c47cac..774f49b51b 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 0000000000..5b6809f334
--- /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 16a36da356..429aabc318 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 92bf4a1a06..cdfd9e578f 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 77f675b0e1..4c9e70d7ce 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 = $@;