Subject: | Bug: using M::B to set formatter fails on verbosity attribute |
Hi all,
I don't have time to fix this right away, so thought I'd file it:
First off, the M::B example given in TAP::Harness breaks:
M::B->new( ...
use_tap_harness => 1,
tap_harness_args => {
...
formatter => 'TAP::Formatter::HTML', # this is the problem
...
$ ./Build test
Unknown arguments to TAP::Harness::new (verbosity) at
/usr/local/perl-5.10.1/lib/5.10.1/Module/Build/Base.pm line 2738
The fix is to update the docs:
...
formatter_class => 'TAP::Formatter::HTML',
But this does raise an issue:
TAP::Harness::_initialize() doesn't actually accept a 'verbosity' attribute for itself, it's passed
on to the formatter it creates. But if a valid formatter is passed it doesn't even look at any of
these arguments. This will cause M::B & others to break as above.
This is a problem of documentation & design... The docs for T::H->new say:
my %args = (
verbosity => 1,
lib => [ 'lib', 'blib/lib', 'blib/arch' ],
)
my $harness = TAP::Harness->new( \%args );
So we could:
1. update the docs to say 'only pass formatter args if you've not passed a formatter'
(confusing)
2. always set formatter args if they're passed to _initialize() with a formatter object (ie:
override args set in the formatter)
3. delete any unused formatter args (black hole: confusing?)
4. redesign so this can't happen (a lot of work?)
-Steve