I'm running some tests via TAP::Harness and now I'm trying to get all the individual results from the TAP parser. What I do is first run the tests:
my $harness = TAP::Harness->new( { verbosity => 1, lib => [ 'blib/lib' ] } );
my $aggregator = $harness->runtests( @tests );
This works great. Then I try to get the results out as per the TAP::Parser documentation:
my @results;
my @parsers = $aggregator->parsers;
foreach my $prsr( @parsers ) {
while( my $result = $prsr->next ) {
push @results, { type => $result->type,
ok => $result->ok,
text => $result->as_string };
}
}
However, this results in @results
being an empty array.
If I Dumper
the individual Parser objects, I can see that they have parsed the test results successfully:
bless( {
'tests_run' => 5,
'actual_passed' => [
1,
2,
3,
4,
5
],
....etc
I can't figure out how to get the test results out of the object.
Well, I was able to get what I wanted by constructing the individual parsers manually and running them.
Then I suppose I can do the aggregation manually, though I'm still hoping there's a way to get the aggregated results and the actual TAP data from a single TAP::Harness instance. I haven't been able to figure that out, though.