dragonchild has asked for the wisdom of the Perl Monks concerning the following question:
Starting with the code Schwern posted (that brian_d_foy links to), I modified it slightly to run through all the tests in a given t/, as so:
use strict; use warnings; use Test::Harness::Straps; my $tester = Test::Harness::Straps->new; use lib 'blib'; my @failures; foreach my $file (<t/*.t>) { local *STDERR; my %results = $tester->analyze_file( $file ); push @failures, $file unless $results{passing}; } if (@failures) { print scalar(@failures), " files failed.\n"; local $"=$/; print "@failures\n"; } else { print "All tests succeeded.\n"; }
When all the tests pass, I get a nice "All tests succeeded." message. But, when the tests fail, especially due to a module that doesn't compile, a bunch of messages appear on STDERR and local *STDERR; doesn't fix that. Turns out it's cause the test file is being run in a sub-process.
Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Test::Harness::Straps and STDERR
by PodMaster (Abbot) on Jan 14, 2005 at 20:01 UTC |