Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Redirecting STDOUT

by Sidhekin (Priest)
on Feb 11, 2007 at 13:14 UTC ( #599457=note: print w/replies, xml ) Need Help??

in reply to Redirecting STDOUT

Test::More->diag() and other test methods are not printing to STDOUT, but to three Test::Builder file handles that default to (dupes of) STDOUT/STDERR/STDOUT respectively.

If you want them all to print to your local STDOUT, I guess this would do it:

my $Test = Test::Builder->new; my @handle_names = qw/ output failure_output todo_output /; my %old; $old{$_} = $Test->$_ for @handle_names; $Test->$_(\*STDOUT) for @handle_names; eval { run_your_tests }; # and restore: $Test->$_($old{$_}) for @handle_names;

For more detail, see Test::Builder.

Update: I couldn't stand to see the cut-and-pasted list of handle names, so I added a variable for it. How's that for obsessive? :-P

print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://599457]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2018-12-19 05:53 GMT
Find Nodes?
    Voting Booth?
    How many stories does it take before you've heard them all?

    Results (83 votes). Check out past polls.