summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter
diff options
context:
space:
mode:
authorafresh1 <afresh1@openbsd.org>2014-03-24 14:58:42 +0000
committerafresh1 <afresh1@openbsd.org>2014-03-24 14:58:42 +0000
commit91f110e064cd7c194e59e019b83bb7496c1c84d4 (patch)
tree3e8e577405dba7e94b43cbf21c22f21aaa5ab949 /gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter
parentdo not call purge_task every 10 secs, it is only needed once at startup and (diff)
downloadwireguard-openbsd-91f110e064cd7c194e59e019b83bb7496c1c84d4.tar.xz
wireguard-openbsd-91f110e064cd7c194e59e019b83bb7496c1c84d4.zip
Import perl-5.18.2
OK espie@ sthen@ deraadt@
Diffstat (limited to 'gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter')
-rw-r--r--gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Base.pm28
-rw-r--r--gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Color.pm4
-rw-r--r--gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Console.pm4
-rw-r--r--gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Console/Session.pm6
-rw-r--r--gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/File.pm4
-rw-r--r--gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/File/Session.pm6
-rw-r--r--gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Session.pm9
7 files changed, 41 insertions, 20 deletions
diff --git a/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Base.pm b/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Base.pm
index 678ea2f0e3d..af7b3fca304 100644
--- a/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Base.pm
+++ b/gnu/usr.bin/perl/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.26
=cut
-$VERSION = '3.23';
+$VERSION = '3.26';
=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/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Color.pm b/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Color.pm
index abf885b0f93..16d6f79d45f 100644
--- a/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Color.pm
+++ b/gnu/usr.bin/perl/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.26
=cut
-$VERSION = '3.23';
+$VERSION = '3.26';
=head1 DESCRIPTION
diff --git a/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Console.pm b/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Console.pm
index 8925e864736..0a9115f9e48 100644
--- a/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Console.pm
+++ b/gnu/usr.bin/perl/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.26
=cut
-$VERSION = '3.23';
+$VERSION = '3.26';
=head1 DESCRIPTION
diff --git a/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Console/Session.pm b/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Console/Session.pm
index b9cdc08eb00..f5b3dc12295 100644
--- a/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Console/Session.pm
+++ b/gnu/usr.bin/perl/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.26
=cut
-$VERSION = '3.23';
+$VERSION = '3.26';
=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/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/File.pm b/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/File.pm
index aaad61b06b3..8d94a2cff7a 100644
--- a/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/File.pm
+++ b/gnu/usr.bin/perl/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.26
=cut
-$VERSION = '3.23';
+$VERSION = '3.26';
=head1 DESCRIPTION
diff --git a/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/File/Session.pm b/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/File/Session.pm
index e7d576ef904..9b61cab3670 100644
--- a/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/File/Session.pm
+++ b/gnu/usr.bin/perl/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.26
=cut
-$VERSION = '3.23';
+$VERSION = '3.26';
=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/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Session.pm b/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Session.pm
index 5c0f57cca21..081ca9aec95 100644
--- a/gnu/usr.bin/perl/cpan/Test-Harness/lib/TAP/Formatter/Session.pm
+++ b/gnu/usr.bin/perl/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.26
=cut
-$VERSION = '3.23';
+$VERSION = '3.26';
=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;