formatter API and subclassing pain points
Andy Armstrong
andy at hexten.net
Tue Sep 11 13:24:00 BST 2007
On 11 Sep 2007, at 11:49, Andy Armstrong wrote:
>> Where the line with the numbers gets no \n, but that means $jobs+1
>> (or
>> +2) new lines of output every time a test completes.
>
> Parallel test runs are a clearly good thing; mandatory to make
> efficient use of multiple cores. So maybe we need to understand and
> embrace parallelism in the formatter? For some formatters it won't
> matter much whether the results arrive in order; for others -
> including the console formatter - it's critical.
Actually the formatter already has nearly the right interface to
support parallel tests.
We have
$formatter->prepare # Called before any testing
$formatter->before_test # At the start of a test script
$formatter->result # For each result
$formatter->after_test # At the end of a test script
$formatter->summary # At the end of the entire test run
If before_test became open_test - and returned an opaque handle that
we then passed to result and after_test (renamed as close_test) then
the interface quite tidily supports multiple concurrent tests.
Does that help Eric? Do you need to generate any output that wouldn't
fit within that scheme?
--
Andy Armstrong, hexten.net
More information about the tapx-dev
mailing list