cannot have --archive option with --harness

Andy Armstrong andy at hexten.net
Wed Sep 5 17:22:59 BST 2007


On 4 Sep 2007, at 19:51, Michael Peters wrote:
> Eric Wilhelm wrote:
>> I was just attempting to demonstrate to Colin how our new parrot
>> TAP::Harness subclass could be used with TAP::Harness::Archive...  
>> oops.
>>
>> I think we really need that to be a mixin or something.
>
> I'm not sure a mix-in will really work since TAP::Harness::Archive  
> overrides
> new() and runtests() which are probably the 2 most important methods.

You don't really need to do any subclassing for prove do you?  
App::Prove now has

sub _runtests {
     my ( $self, $args, $harness_class, @tests ) = @_;
     my $harness    = $harness_class->new($args);
     my $aggregator = $harness->runtests(@tests);

     exit $aggregator->has_problems ? 1 : 0;
}

which looks like a reasonable place to inject your functionality: new  
and runtests in one place.

 From a quick skim of your code it looks like you don't actually need  
to replace runtests - just arrange for your code to be executed  
either side of it. Is that right?

-- 
Andy Armstrong, hexten.net



More information about the tapx-dev mailing list