summaryrefslogtreecommitdiff
path: root/lib/TAP
diff options
context:
space:
mode:
authorAndy Armstrong <andy@hexten.net>2007-12-20 17:49:07 +0000
committerNicholas Clark <nick@ccl4.org>2007-12-20 18:25:46 +0000
commit69f36734c100b00aa1a0212b12ebd8485f366fef (patch)
treedba23e9d2268d78cb90b54cb8001d3549fbac634 /lib/TAP
parent56d7a0868d14c11c08f61a0acccc9ee745b4e081 (diff)
downloadperl-69f36734c100b00aa1a0212b12ebd8485f366fef.tar.gz
bring Test::Harness up to 3.06
Message-Id: <5C57804B-6F71-4875-AEB6-C449F893E001@hexten.net> Date: Thu, 20 Dec 2007 17:49:07 +0000 p4raw-id: //depot/perl@32673
Diffstat (limited to 'lib/TAP')
-rw-r--r--lib/TAP/Base.pm4
-rw-r--r--lib/TAP/Formatter/Color.pm4
-rw-r--r--lib/TAP/Formatter/Console.pm19
-rw-r--r--lib/TAP/Formatter/Console/ParallelSession.pm4
-rw-r--r--lib/TAP/Formatter/Console/Session.pm4
-rw-r--r--lib/TAP/Harness.pm12
-rw-r--r--lib/TAP/Parser.pm7
-rw-r--r--lib/TAP/Parser/Aggregator.pm10
-rw-r--r--lib/TAP/Parser/Grammar.pm4
-rw-r--r--lib/TAP/Parser/Iterator.pm4
-rw-r--r--lib/TAP/Parser/Iterator/Array.pm4
-rw-r--r--lib/TAP/Parser/Iterator/Process.pm4
-rw-r--r--lib/TAP/Parser/Iterator/Stream.pm4
-rw-r--r--lib/TAP/Parser/Multiplexer.pm4
-rw-r--r--lib/TAP/Parser/Result.pm4
-rw-r--r--lib/TAP/Parser/Result/Bailout.pm4
-rw-r--r--lib/TAP/Parser/Result/Comment.pm4
-rw-r--r--lib/TAP/Parser/Result/Plan.pm4
-rw-r--r--lib/TAP/Parser/Result/Test.pm4
-rw-r--r--lib/TAP/Parser/Result/Unknown.pm4
-rw-r--r--lib/TAP/Parser/Result/Version.pm4
-rw-r--r--lib/TAP/Parser/Result/YAML.pm4
-rw-r--r--lib/TAP/Parser/Source.pm4
-rw-r--r--lib/TAP/Parser/Source/Perl.pm6
-rw-r--r--lib/TAP/Parser/YAMLish/Reader.pm4
-rw-r--r--lib/TAP/Parser/YAMLish/Writer.pm4
26 files changed, 75 insertions, 63 deletions
diff --git a/lib/TAP/Base.pm b/lib/TAP/Base.pm
index 3985f7bebe..9919095c69 100644
--- a/lib/TAP/Base.pm
+++ b/lib/TAP/Base.pm
@@ -9,11 +9,11 @@ TAP::Base - Base class that provides common functionality to L<TAP::Parser> and
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
my $GOT_TIME_HIRES;
diff --git a/lib/TAP/Formatter/Color.pm b/lib/TAP/Formatter/Color.pm
index 7529da5091..063fb07421 100644
--- a/lib/TAP/Formatter/Color.pm
+++ b/lib/TAP/Formatter/Color.pm
@@ -70,11 +70,11 @@ TAP::Formatter::Color - Run Perl test scripts with color
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 DESCRIPTION
diff --git a/lib/TAP/Formatter/Console.pm b/lib/TAP/Formatter/Console.pm
index f239ec98f9..9e79d9ad08 100644
--- a/lib/TAP/Formatter/Console.pm
+++ b/lib/TAP/Formatter/Console.pm
@@ -20,7 +20,7 @@ BEGIN {
errors => sub { shift; shift },
color => sub { shift; shift },
jobs => sub { shift; shift },
- stdout => sub {
+ stdout => sub {
my ( $self, $ref ) = @_;
$self->_croak("option 'stdout' needs a filehandle")
unless ( ref $ref || '' ) eq 'GLOB'
@@ -52,11 +52,11 @@ TAP::Formatter::Console - Harness output delegate for default console output
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 DESCRIPTION
@@ -312,8 +312,9 @@ sub summary {
$self->_printed_summary_header(0);
my ($parser) = $aggregate->parsers($test);
$self->_output_summary_failure(
- 'failed', " Failed test number(s): ",
- $test, $parser
+ 'failed',
+ [ ' Failed test: ', ' Failed tests: ' ],
+ $test, $parser
);
$self->_output_summary_failure(
'todo_passed',
@@ -363,10 +364,12 @@ sub _output_summary_failure {
# ugly hack. Must rethink this :(
my $output = $method eq 'failed' ? '_failure_output' : '_output';
- if ( $parser->$method() ) {
+ if ( my @r = $parser->$method() ) {
$self->_summary_test_header( $test, $parser );
- $self->$output($name);
- my @results = $self->_balanced_range( 40, $parser->$method() );
+ my ( $singular, $plural )
+ = 'ARRAY' eq ref $name ? @$name : ( $name, $name );
+ $self->$output( @r == 1 ? $singular : $plural );
+ my @results = $self->_balanced_range( 40, @r );
$self->$output( sprintf "%s\n" => shift @results );
my $spaces = ' ' x 16;
while (@results) {
diff --git a/lib/TAP/Formatter/Console/ParallelSession.pm b/lib/TAP/Formatter/Console/ParallelSession.pm
index b4caac468b..96ca2cfc1d 100644
--- a/lib/TAP/Formatter/Console/ParallelSession.pm
+++ b/lib/TAP/Formatter/Console/ParallelSession.pm
@@ -48,11 +48,11 @@ TAP::Formatter::Console::ParallelSession - Harness output delegate for parallel
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 DESCRIPTION
diff --git a/lib/TAP/Formatter/Console/Session.pm b/lib/TAP/Formatter/Console/Session.pm
index 54907045c7..eb2cf50a6d 100644
--- a/lib/TAP/Formatter/Console/Session.pm
+++ b/lib/TAP/Formatter/Console/Session.pm
@@ -36,11 +36,11 @@ TAP::Formatter::Console::Session - Harness output delegate for default console o
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 DESCRIPTION
diff --git a/lib/TAP/Harness.pm b/lib/TAP/Harness.pm
index b792306b89..9dcd92c1a3 100644
--- a/lib/TAP/Harness.pm
+++ b/lib/TAP/Harness.pm
@@ -22,11 +22,11 @@ TAP::Harness - Run test scripts with statistics
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
$ENV{HARNESS_ACTIVE} = 1;
$ENV{HARNESS_VERSION} = $VERSION;
@@ -431,7 +431,13 @@ sub _aggregate_single {
while ( defined( my $result = $parser->next ) ) {
$session->result($result);
- exit 1 if $result->is_bailout;
+ if ( $result->is_bailout ) {
+
+ # Keep reading until input is exhausted in the hope
+ # of allowing any pending diagnostics to show up.
+ 1 while $parser->next;
+ exit 1;
+ }
}
$self->finish_parser( $parser, $session );
diff --git a/lib/TAP/Parser.pm b/lib/TAP/Parser.pm
index 74bb137b1b..7bfe557369 100644
--- a/lib/TAP/Parser.pm
+++ b/lib/TAP/Parser.pm
@@ -19,11 +19,11 @@ TAP::Parser - Parse L<TAP|Test::Harness::TAP> output
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
my $DEFAULT_TAP_VERSION = 12;
my $MAX_TAP_VERSION = 13;
@@ -865,7 +865,8 @@ failed, any TODO tests unexpectedly succeeded, or any parse errors occurred.
sub has_problems {
my $self = shift;
- return $self->failed
+ return
+ $self->failed
|| $self->parse_errors
|| $self->wait
|| $self->exit;
diff --git a/lib/TAP/Parser/Aggregator.pm b/lib/TAP/Parser/Aggregator.pm
index 24e163826a..881b5f2f0c 100644
--- a/lib/TAP/Parser/Aggregator.pm
+++ b/lib/TAP/Parser/Aggregator.pm
@@ -10,11 +10,11 @@ TAP::Parser::Aggregator - Aggregate TAP::Parser results
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 SYNOPSIS
@@ -249,7 +249,8 @@ Return true if all the tests passed and no parse errors were detected.
sub all_passed {
my $self = shift;
- return $self->total
+ return
+ $self->total
&& $self->total == $self->passed
&& !$self->has_errors;
}
@@ -370,7 +371,8 @@ Returns true if I<any> of the parsers failed. This includes:
sub has_errors {
my $self = shift;
- return $self->failed
+ return
+ $self->failed
|| $self->parse_errors
|| $self->exit
|| $self->wait;
diff --git a/lib/TAP/Parser/Grammar.pm b/lib/TAP/Parser/Grammar.pm
index f516645754..7e6e449625 100644
--- a/lib/TAP/Parser/Grammar.pm
+++ b/lib/TAP/Parser/Grammar.pm
@@ -12,11 +12,11 @@ TAP::Parser::Grammar - A grammar for the Test Anything Protocol.
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 DESCRIPTION
diff --git a/lib/TAP/Parser/Iterator.pm b/lib/TAP/Parser/Iterator.pm
index 2eece34802..8b65f0631c 100644
--- a/lib/TAP/Parser/Iterator.pm
+++ b/lib/TAP/Parser/Iterator.pm
@@ -13,11 +13,11 @@ TAP::Parser::Iterator - Internal TAP::Parser Iterator
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 SYNOPSIS
diff --git a/lib/TAP/Parser/Iterator/Array.pm b/lib/TAP/Parser/Iterator/Array.pm
index 175c4f20e8..900c66598b 100644
--- a/lib/TAP/Parser/Iterator/Array.pm
+++ b/lib/TAP/Parser/Iterator/Array.pm
@@ -11,11 +11,11 @@ TAP::Parser::Iterator::Array - Internal TAP::Parser Iterator
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 SYNOPSIS
diff --git a/lib/TAP/Parser/Iterator/Process.pm b/lib/TAP/Parser/Iterator/Process.pm
index 3f89c84698..be048080b0 100644
--- a/lib/TAP/Parser/Iterator/Process.pm
+++ b/lib/TAP/Parser/Iterator/Process.pm
@@ -19,11 +19,11 @@ TAP::Parser::Iterator::Process - Internal TAP::Parser Iterator
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 SYNOPSIS
diff --git a/lib/TAP/Parser/Iterator/Stream.pm b/lib/TAP/Parser/Iterator/Stream.pm
index c745471a4a..f3b60bfaec 100644
--- a/lib/TAP/Parser/Iterator/Stream.pm
+++ b/lib/TAP/Parser/Iterator/Stream.pm
@@ -11,11 +11,11 @@ TAP::Parser::Iterator::Stream - Internal TAP::Parser Iterator
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 SYNOPSIS
diff --git a/lib/TAP/Parser/Multiplexer.pm b/lib/TAP/Parser/Multiplexer.pm
index ee86bd5040..24575ff8f3 100644
--- a/lib/TAP/Parser/Multiplexer.pm
+++ b/lib/TAP/Parser/Multiplexer.pm
@@ -14,11 +14,11 @@ TAP::Parser::Multiplexer - Multiplex multiple TAP::Parsers
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 SYNOPSIS
diff --git a/lib/TAP/Parser/Result.pm b/lib/TAP/Parser/Result.pm
index 527ac11d61..371057dd0a 100644
--- a/lib/TAP/Parser/Result.pm
+++ b/lib/TAP/Parser/Result.pm
@@ -27,11 +27,11 @@ TAP::Parser::Result - TAP::Parser output
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head2 DESCRIPTION
diff --git a/lib/TAP/Parser/Result/Bailout.pm b/lib/TAP/Parser/Result/Bailout.pm
index 2583a387b4..4a211494d2 100644
--- a/lib/TAP/Parser/Result/Bailout.pm
+++ b/lib/TAP/Parser/Result/Bailout.pm
@@ -12,11 +12,11 @@ TAP::Parser::Result::Bailout - Bailout result token.
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 DESCRIPTION
diff --git a/lib/TAP/Parser/Result/Comment.pm b/lib/TAP/Parser/Result/Comment.pm
index 01699db907..9d5f80e4df 100644
--- a/lib/TAP/Parser/Result/Comment.pm
+++ b/lib/TAP/Parser/Result/Comment.pm
@@ -12,11 +12,11 @@ TAP::Parser::Result::Comment - Comment result token.
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 DESCRIPTION
diff --git a/lib/TAP/Parser/Result/Plan.pm b/lib/TAP/Parser/Result/Plan.pm
index 85735c36e9..a245be2ce9 100644
--- a/lib/TAP/Parser/Result/Plan.pm
+++ b/lib/TAP/Parser/Result/Plan.pm
@@ -12,11 +12,11 @@ TAP::Parser::Result::Plan - Plan result token.
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 DESCRIPTION
diff --git a/lib/TAP/Parser/Result/Test.pm b/lib/TAP/Parser/Result/Test.pm
index 50326f078a..d08cacf508 100644
--- a/lib/TAP/Parser/Result/Test.pm
+++ b/lib/TAP/Parser/Result/Test.pm
@@ -14,11 +14,11 @@ TAP::Parser::Result::Test - Test result token.
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 DESCRIPTION
diff --git a/lib/TAP/Parser/Result/Unknown.pm b/lib/TAP/Parser/Result/Unknown.pm
index bfef1d60b3..079ba595b8 100644
--- a/lib/TAP/Parser/Result/Unknown.pm
+++ b/lib/TAP/Parser/Result/Unknown.pm
@@ -14,11 +14,11 @@ TAP::Parser::Result::Unknown - Unknown result token.
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 DESCRIPTION
diff --git a/lib/TAP/Parser/Result/Version.pm b/lib/TAP/Parser/Result/Version.pm
index f646fe2a42..f52bfa9daf 100644
--- a/lib/TAP/Parser/Result/Version.pm
+++ b/lib/TAP/Parser/Result/Version.pm
@@ -12,11 +12,11 @@ TAP::Parser::Result::Version - TAP version result token.
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 DESCRIPTION
diff --git a/lib/TAP/Parser/Result/YAML.pm b/lib/TAP/Parser/Result/YAML.pm
index 9e2c955c85..4db3b27a5d 100644
--- a/lib/TAP/Parser/Result/YAML.pm
+++ b/lib/TAP/Parser/Result/YAML.pm
@@ -12,11 +12,11 @@ TAP::Parser::Result::YAML - YAML result token.
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 DESCRIPTION
diff --git a/lib/TAP/Parser/Source.pm b/lib/TAP/Parser/Source.pm
index 747b483915..c645efeaa5 100644
--- a/lib/TAP/Parser/Source.pm
+++ b/lib/TAP/Parser/Source.pm
@@ -14,11 +14,11 @@ TAP::Parser::Source - Stream output from some source
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 DESCRIPTION
diff --git a/lib/TAP/Parser/Source/Perl.pm b/lib/TAP/Parser/Source/Perl.pm
index 72c3a398fb..30d0c0aa30 100644
--- a/lib/TAP/Parser/Source/Perl.pm
+++ b/lib/TAP/Parser/Source/Perl.pm
@@ -16,11 +16,11 @@ TAP::Parser::Source::Perl - Stream Perl output
=head1 VERSION
-Version 3.05
+Version 3.06
=cut
-$VERSION = '3.05';
+$VERSION = '3.06';
=head1 DESCRIPTION
@@ -272,7 +272,7 @@ sub _switches {
sub _get_perl {
my $proto = shift;
- return $ENV{HARNESS_PERL} if defined $ENV{HARNESS_PERL};
+ return $ENV{HARNESS_PERL} if defined $ENV{HARNESS_PERL};
return Win32::GetShortPathName($^X) if IS_WIN32;
return $^X;
}
diff --git a/lib/TAP/Parser/YAMLish/Reader.pm b/lib/TAP/Parser/YAMLish/Reader.pm
index d041ca615e..aaba1bbccf 100644
--- a/lib/TAP/Parser/YAMLish/Reader.pm
+++ b/lib/TAP/Parser/YAMLish/Reader.pm
@@ -4,7 +4,7 @@ use strict;
use vars qw{$VERSION};
-$VERSION = '3.05';
+$VERSION = '3.06';
# TODO:
# Handle blessed object syntax
@@ -277,7 +277,7 @@ TAP::Parser::YAMLish::Reader - Read YAMLish data from iterator
=head1 VERSION
-Version 3.05
+Version 3.06
=head1 SYNOPSIS
diff --git a/lib/TAP/Parser/YAMLish/Writer.pm b/lib/TAP/Parser/YAMLish/Writer.pm
index 4d2ed01e24..446114cef9 100644
--- a/lib/TAP/Parser/YAMLish/Writer.pm
+++ b/lib/TAP/Parser/YAMLish/Writer.pm
@@ -4,7 +4,7 @@ use strict;
use vars qw{$VERSION};
-$VERSION = '3.05';
+$VERSION = '3.06';
my $ESCAPE_CHAR = qr{ [ \x00-\x1f \" ] }x;
@@ -147,7 +147,7 @@ TAP::Parser::YAMLish::Writer - Write YAMLish data
=head1 VERSION
-Version 3.05
+Version 3.06
=head1 SYNOPSIS