bug in TAP::Harness->new

Steve Purkis steve at purkis.ca
Thu Jun 26 21:22:39 UTC 2008


On Jun 26, 2008, at 11:41, Andy Armstrong wrote:

> On 26 Jun 2008, at 10:50, Steve Purkis wrote:
>
>> Quick report, sorry I don't have time to fix it now.  In
>> TAP::Harness 3.12
>>
>> # setup %args
>> # verbosity => 1
>> # formatter => TAP::Formatter::HTML=HASH(0x94a9f18)
>> # merge => 1
>> [snip]
>
> I'm not sure if I understand correctly - but verbosity is only a valid
> argument if the harness creates its own formatter.

Ah - apparently _I_ didn't understand ;-)


> It's not ideal; it's a legacy from when the harness did the formatting
> itself. So effectively there are two modes of operation:
>
> 1) you don't explicitly pass a formatter to the harness; the harness
> creates a formatter and forwards directives, verbosity, timer,
> failures, errors, stdout and color to that formatter.
>
> 2) you create your own formatter in which case harness claims to be
> ignorant of all those arguments.

Fair enough.


> So we should at least say in the documentation that you can pass a
> formatter /or/ you can pass any of the above arguments and have the
> harness create the default formatter - but not both.

Agreed.  And a more helpful croak that states exactly that.

See the attached patch.  I've not committed it because it breaks  
tests in a strange way...  Both './Build test test_files=t/harness.t'  
& 'prove t/harness.t' pass, but when I run 'perl -Ilib t/harness.t'  
it breaks ??

Looking into why:
...
not ok 70 - ... and failing test output should be correct
#   Failed test '... and failing test output should be correct'
#   at t/harness.t line 315.
#     Structures begin differing at:
#          $got->[1] = 't/source_tests/harness_failure....1/2'
#     $expected->[1] = 'Failed 1/2 subtests'

Running with perl -d:
220==>b     is_deeply \@output, \@expected, '... and the output  
should be correct';
221:        like $status, $expected_status,
222           '... and the status line should be correct';
223:        like $summary, $expected_summary,
224           '... and the report summary should look correct';
225
226         # normal tests in really_quiet mode
                                                                         
                                                                         
                 DB<3> x \@output, \@expected
0  ARRAY(0x188d43c)
    0  't/source_tests/harness....'
    1  't/source_tests/harness....1/1'
    2  't/source_tests/harness....'
    3  'ok'
    4  'All tests successful.'
1  ARRAY(0x18e5e1c)
    0  't/source_tests/harness....'
    1  'ok'
    2  'All tests successful.'


Colour me confused.

-Steve


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test-Harness-verbosity-formatter-err.patch
Type: application/octet-stream
Size: 2195 bytes
Desc: not available
Url : http://www.hexten.net/pipermail/tapx-dev/attachments/20080626/6bc44fac/attachment.obj 
-------------- next part --------------




More information about the tapx-dev mailing list