On Tue, 2005-03-08 at 10:25 -0800, Michael G Schwern wrote:

> What's still missing is a way to swap out the Test::Builder singleton with
> your own custom subclass instance.  There's some complicated issues there
> which chromatic and I talked over a couple years ago and then promptly did
> nothing with.
> 
> chromatic, do you still have those notes?

Hm, not anywhere close.  I think they were on your laptop, the one you
took apart at the last TPC in San Diego.

I've been writing notes for Test::Builder for Perl 6, though.  It's a
little something like:

Test::Builder - the primary interface.  Not a singleton anymore.  Test
modules create new instances and tell it the default level.  This
removes a global variable.

Test::Builder::Output - a singleton contained within Test::Builder.
This holds the output filehandles.

Test::Builder::TestRun - a singleton contained within Test::Builder.
This holds the plan, the counter, and the test details.

Test::Builder::Counter - a singleton contained within
Test::Builder::TestRun.  This counts the tests.

Test::Builder::TestResults - the parent class for all types of tests
(pass, fail, todo, skip).  This may be too much detail here, but I like
the idea of these knowing how to format themselves for output.

By default, everything looks the same to using modules, except that the
level trickery can go away, mostly.  It should be easy to swap out
TestRun and Counter and TestResults within the current Test::Builder
object temporarily, in the case of wanting to run a lot of subtests
without increasing the number, for example.

Just some ideas,
-- c

Reply via email to