bug in TAP::Harness->new

Andy Armstrong andy at hexten.net
Thu Jun 26 10:41:54 UTC 2008


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
>
> my $verbosity = delete $args{verbosity}; # BUG? valid arg, but T::H
> complains
> my $harness   = TAP::Harness->new( \%args );
> my @tests     = glob "$testdir/$glob";
> $harness->verbosity( $verbosity );


I'm not sure if I understand correctly - but verbosity is only a valid  
argument if the harness creates its own formatter.

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.

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.

-- 
Andy Armstrong, Hexten





More information about the tapx-dev mailing list