It's still correct, except the parts about how the events work. That's all
changed. It's quite useful getting your head around what Test::Builder2 is
and why it has to exist.
Federation
----------
Test::Builder2 will be a federated system, meaning there will not be one
builder but many. This greatly expands what people can do with Test::Builder2
without running into the limits of my design. People can write their own
builders with their own way of doing asserts. Builders are coordinated by
passing events when they do things. Events include things like assert
results, starting and ending test streams, test plans and so on.
See "The EventCoordinator" below.
Federation also mitigates the effect of the way that Test::Builder2 does
asserts. After investigating how other systems and languages do it, the
Test::Builder way is a bit... different. This allows more traditional systems
to be built (such as JUnit style exception throwers) and alternative systems
(like Fennic) while still remaining coordinated.
The EventCoordinator
--------------------
Previously, a builder handed events off to the Formatter and History objects
directly. This had a number of problems. First, making sure all the builders
were talking to the same Formatter and History object (if they wanted to) was
getting complex. Second, 3rd parties want to know about events (for example
Test::NoWarnings or die-on-fail) and that was getting complicated.
hdp and rjbs convinced me at PPW over booze that the way I was handling events
was wrong. They said a middleman was needed to hold onto the Formatter and
History and anything else that wanted to be informed of events. Thus, the
EventCoordinator. Builders all contain the EventCoordinator object to which
they pass events as they happen. The Formatter and History are hung off the
EventCoordinator and are informed of events as they happen. Anyone else can
hang more EventWatchers off the EventCoordinator as desired to take some
action as events happen or even alter events as they go by.
The EventCoordinator is being built in the TB2-event-coordinator branch. As
of this writing the EC is complete but nothing is using it. I'm working on
that now. At the moment I'm defining events well enough that everyone can use
them on equal footing.
Rewriting Test::Builder's own tests
-----------------------------------
How do you test a testing system? With another testing system.
Unfortunately, this practice wasn't followed in Test::Builder's tests.
They're a mish-mash of hand rolled test functions and careful use of itself to
test itself. This makes life complicated especially when you're rewriting the
fundamentals of the testing system.
Fortunately, there now exists t/test.pl which is a good chunk of Test::More
implemented independently. It comes from the Perl core. Now the tests need
to be rewritten to use it. In many cases, it's a rote change. In some cases
it's a bit more complicated. But it's a task anyone can tackle in small
pieces. Grab a test and rewrite it using t/test.pl.
Another piece to tackle is porting is_deeply() to t/test.pl. It's the only
major Test::More function missing. You need not port the diagnostic
functionality, that's the complicated bit, just the comparison.
Alpha 2
-------
The EventCoordinator is the last major architectural piece in Test::Builder2.
Once that is done I will release a new alpha.
It's been a while since alpha 1, a lot has changed. While people tested alpha
1, there wasn't much uptake. That's ok, it wasn't very complete or usable or
stable. Alpha 2 will be more complete and usable.
--
On error resume stupid
> It's been a while since alpha 1, a lot has changed. While people tested alpha
> 1, there wasn't much uptake. That's ok, it wasn't very complete or usable or
> stable. Alpha 2 will be more complete and usable.
Sounds awesome, Schwern. Thanks for the work!
David