----- Original Message ----
From: Michael G Schwern <[EMAIL PROTECTED]>

> > What about an optional environment variable
> > which forcess *all* output to STDOUT  or STDERR
> > but, if not present, leaves things as is?
>
> Did anyone think to try it?
>
> $ cat ~/tmp/stdout.t
> #!/usr/bin/perl -w
>
> use Test::More tests => 1;
>
> my $tb = Test::More->builder;
>
> $tb->failure_output( $tb->output );
>
> is 23, 42;
> 
> 
> $ perl -MTest::Harness -wle 'runtests @ARGV' ~/tmp/stdout.t 
> /Users/schwern/tmp/stdout....dubious                                         
>        Test returned status 1 (wstat 256, 0x100)
> DIED. FAILED test 1
>        Failed 1/1 tests, 0.00% okay
> Failed Test                 Stat Wstat Total Fail  Failed  List of Failed
> -------------------------------------------------------------------------------
> /Users/schwern/tmp/stdout.t    1   256     1    1 100.00%  1
> Failed 1/1 test scripts, 0.00% okay. 1/1 subtests failed, 0.00% okay.
>
> Test::Harness throws out all non-TAP stuff going to STDOUT.
> This includes comments.  So if Test::Builder started sending
> its diagnostics to STDOUT they'd disappear into the ether.

I have a bit of a problem, I think.  It could simply be a matter of 
misunderstanding how things work, but I have the following bit of code in 
TAPx::Parser::Source::Perl:

    my $sym = gensym;
    if ( open $sym, "$command 2>&1 |" ) {
        return TAPx::Parser::Iterator->new($sym);
    }
    else {
        $self->exit($? >> 8);
        $self->error("Could not execute ($command): $!");
        warn $self->error;
        return;
    }

I've gotten a report that the open command fails on Windows.  Not a surprise, 
now that I think about it.  However, I don't know of any portable way of 
forcing STDERR to STDOUT (and I don't have a Windows box handy).  This means 
that my 2000+ TAPx::Parser tests are in trouble.  If Test::Builder accepted an 
environment variable which allowed me to override this, I might have a way out. 
 So far removing the 2>&1 seems to make my tests pass on a Linux box, but that 
strikes me as bizarre as I thought STDERR wouldn't get read that way.  What the 
heck am I misunderstanding?

Cheers,
Ovid




Reply via email to