In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/c8fbf4a0405c1b43d860af2d332b5193efe24706?hp=bc7bbd314b9de6da4e0b8bf6a3c1ced7645acc76>
- Log ----------------------------------------------------------------- commit c8fbf4a0405c1b43d860af2d332b5193efe24706 Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Aug 19 22:22:21 2016 -0700 podcheck.t: Send helpful error output to stderr While we do try to keep stderr clean for tests, that is for *passing* tests. If the diagnostic output goes to stdout instead, then nobody gets to see it for âmake testâ, which means that the script has to be re-run by itself just to find out what failed. Since this is a long-running test, that is quite inconvenient. Also mention which .t the output is coming from. ----------------------------------------------------------------------- Summary of changes: t/porting/podcheck.t | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/t/porting/podcheck.t b/t/porting/podcheck.t index f0c3990..a6c8528 100644 --- a/t/porting/podcheck.t +++ b/t/porting/podcheck.t @@ -531,16 +531,20 @@ sub suppressed { last SKIP; } - sub note { - my $message = shift; + sub _note { + my ($andle, $message) = @_; chomp $message; - print $message =~ s/^/# /mgr; - print "\n"; + print $andle $message =~ s/^/# /mgr; + print $andle "\n"; return; } + sub note { unshift @_, \*STDOUT; goto &_note } + + sub diag { unshift @_, \*STDERR; goto &_note } + END { if ($planned && $planned != $current_test) { print STDERR @@ -2133,7 +2137,7 @@ foreach my $filename (@files) { } ok(@diagnostics == $thankful_diagnostics, $output); if (@diagnostics) { - note(join "", @diagnostics, + diag(join "", @diagnostics, "See end of this test output for your options on silencing this"); } @@ -2165,7 +2169,7 @@ if (%files_with_unknown_issues) { : "were $were_count_files files"; my $message = <<EOF; -HOW TO GET THIS .t TO PASS +HOW TO GET ${\__FILE__} TO PASS There $were_count_files that had new potential problems identified. Some of them may be real, and some of them may be false positives because @@ -2204,9 +2208,9 @@ EOF and change the count of known potential problems to -1. EOF - note($message); + diag($message); } elsif (%files_with_fixes) { - note(<<EOF + diag(<<EOF To teach this test script that the potential problems have been fixed, $how_to EOF -- Perl5 Master Repository