Ovid wrote:
----- Original Message ----
From: ivorw <[EMAIL PROTECTED]>

I've had similar issues with test output out of sequence, especially when
I pipe the output into more or tee (sometimes 2>&1 helps, but not
always).

What about an optional environment variable which forcess *all* output to 
STDOUT  or STDERR but, if not present, leaves things as is?  Seems like that 
would work and would also be backwards compatible.

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.


Oh look, no diagnostics at all.

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.

Now we'd have to change the behavior of Test::Harness AND Test::Builder at the 
same time.  Test::Builder (and by extension most of the Test modules on CPAN) 
would now depend on a very, very recent version of Test::Harness.  I'm not 
ready to be that cavalier with critical core toolchain dependencies.  This is 
not worth that kind of hell (for me).

And no, I'm not going to have Test::Builder trying to guess at what version of 
Test::Harness its being run under.

Even so its still not a good idea because when a TODO test fails the way it 
hides its failure diagnostics is by sending them to STDOUT.  Now they'd start 
showing up and Test::Harness would need a way to tell the difference between 
diagnostics associated with a real failure and ones associated with a TODO 
failure.

People, this ain't gonna fly.


Here's how you really fix it.
1)  Give up trying to fix the current diagnostics.  They're unformatted 
comments.
2)  Hammer out a real diagnostic TAP syntax such as this
   http://perl-qa.yi.org/index.php/TAP_diagnostic_syntax

Reply via email to