Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^3: Intercepting TAP output

by peters (Sexton)
on May 09, 2008 at 00:47 UTC ( #685575=note: print w/replies, xml ) Need Help??

in reply to Re^2: Intercepting TAP output
in thread Intercepting TAP output

I have boiled it down to this demo. TAP::Harness looks like the best driver and it has a callback that lets me get at the parser before it would otherwise be used. Silencing the harness means that it never gets to find out that its parsers have been drained.
use TAP::Harness; my $harness = TAP::Harness->new( { verbosity => -3, merge => 1 } ); my @tests = glob "t/*.t"; $harness->callback( made_parser => \&hijack_parser ); $harness->runtests( @tests ); sub hijack_parser { my ($parser, $test_ref) = @_; while ( my $result = $parser->next ) { $result->is_test or next; $result->is_actual_ok and next; (my $description = $result->description) =~ s/- //; print "I seem to have failed $description in $test_ref->[1]\n"; } }
Peter Scott
Perl Medic

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://685575]
[ambrus]: the annotation mentions Brisbane as even worse, and I add Debrecen
[marto]: :)
[ambrus]: robby: dunno, I would like to visit London some time, although there are other places I'd like to visit more
[marto]: "Okay, sure, there are in fact museums and art galleries and other culturally enlightened things to do in Glasgow, but that wouldn't have made a funny comic"
LanX .oO( cemetery breweries ? )

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2017-12-15 11:09 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (431 votes). Check out past polls.