On Fri, Jul 29, 2005 at 03:26:17PM +0100, Adrian Howard wrote:
> On 29 Jul 2005, at 06:07, Michael G Schwern wrote:
> >BEGIN { *STDERR = *STDOUT }
> >
> >That'll handle anything, Test::Builder or not.
>
> Nope. T::H::S turns
>
> analyse_file( 'foo.t' )
>
> into something like
>
> open(FILE, "/usr/bin/perl foo.t|" )
>
> so the test script will get it STDERR disassociated from the piped
> STDOUT.
Perhaps you misunderstand. I mean to put that BEGIN { *STDERR = *STDOUT }
in the test script. foo.t never prints to STDERR. Here's a simple
demonstration:
$ perl -wle 'BEGIN { *STDERR = *STDOUT } use Test::More tests => 1; is( 23, 42
)' > test.out
$ cat test.out
1..1
not ok 1
# Failed test in -e at line 1.
# got: '23'
# expected: '42'
# Looks like you failed 1 test of 1.
Or perhaps I misunderstand.
--
Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern
You know what the chain of command is? It's the chain I go get and beat you
with 'til you understand who's in ruttin' command here.
-- Jayne Cobb, "Firefly"