develooper Front page | | Postings from January 2005

Re: Test::Unit, ::Class, or ::Inline?

Thread Previous | Thread Next
Michael G Schwern
January 26, 2005 15:51
Re: Test::Unit, ::Class, or ::Inline?
Message ID:
On Wed, Jan 26, 2005 at 06:28:20PM -0500, David Golden wrote:
> But is there any reason they can't be run in the same process?

In general I think its a bad idea for the test and the thing which generates
its output to be in the same process.  Why?  Because then how do you, the
user, change the output format?  You have to trust that the test author
used something that you can pass in arguments or environment variables or
whatever to be able to spit out the format you want.  This is, of course, the
problem with any all-in-one system.  The various implementations of XUnit, 
for example, have this problem.  And then what happens if Module::Foo is
using Foo::Runner that takes its arguments in one way and Module::Bar is
using Bar::Runner that takes its arguments in another way?

The nice part of the "test | parser" model is because there's a common
format you can stick any parser on the end and generate any output you
like.  The current trouble is we have only one parser and its not terribly

But there's no technical reason.

> Or have them write the usual ok/not ok to stdout and write detail in a 
> structured form to some other process through a socket or to a log file.

I'd like to keep the output short and human readable.  YAML may be 
human readable but all that extra information would not be short.  Your
idea of sticking it all into a file may have merit.

You can play with most of this now from Test::Builder->results.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About