cannot have --archive option with --harness

Andy Armstrong andy at hexten.net
Wed Sep 5 18:35:14 BST 2007


On 5 Sep 2007, at 17:36, Michael Peters wrote:

> Andy Armstrong wrote:
>
>> And if you wanted to make things tidier we could add before_runtests
>> and after_runtests callbacks to the harness that you could hook your
>> code into.
>
> That would definitely take care of runtests(), but what about new 
> ()? I'd still
> need to be able to store the destination archive filename somewhere  
> and now I'd
> need to register some callbacks too.

You'd just store that stuff in your object I think. I'm imagining  
you'd have something like

package Test::TAP::Archive;

sub new {
     my ($class, $harness, $options) = @_;

     # Do your init here

     $harness->callback('before_runtests', sub {
         # Do your before processing
     });

     $harness->callback('after_runtests', sub {
         # Do your after processing
     });

}

Does that work?

-- 
Andy Armstrong, hexten.net



More information about the tapx-dev mailing list