On Tue, 2005-03-08 at 17:31 -0500, David Golden wrote:

> Let me say it a different way.  Right now, Test::Builder and 
> Test::Harness (et al.) are tightly coupled.  It would be nice to break 
> or at least reduce that coupling.  Stuff deep in Test::Builder assumes 
> that the output is TAP.  For example, consider the way that ok() doesn't 
> just store a result in the results array but goes to all the trouble to 
> print it out in TAP format with both _print() and _print_diag(), too.  
> (Presumably, that's what's being refactored into TestOutput?) 

Yes, that's the goal.  I want to collect all of the actual printing of
output into one class.  Not only does it make Test::Builder smaller, it
is easier to maintain and it allows weird things like Test::Tester and
Test::Builder::Tester and non-TAP output.

You're on your own for writing the different output class though.

> One of the side effects of this is that diagnostic messages from the 
> ok() blend in with any user generated diagnostics and that's the only 
> way to get at them.

Yeah, it would be nice if we had a better way to handle this.  Perhaps
changing the idiom to:

        $Test->ok( $dressed_up, 'How nice do you look?' ) ||
        $Test->reason( 'Refusing to wear a tie and jacket' );

and encouraging Test::* module authors to adopt that type of error
reporting will help.

On the other hand, it doesn't do anything differently with TAP as
currently defined, and I share Schwern's case of howling fantods at
recommending that people look in Test::Builder's test results list.  Out
of process interpreting and reporting feels so much nicer.

-- c

Reply via email to