Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2018-09-26 06:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Eventually, "covfefe" will come to mean:













    Results (205 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!