|
Hello,
I'm having a lot of trouble getting the results I need out of TAP::Harness, and I could use some help.
I've used Test::Harness before, but only as a means to drive a set of test files, not to spend any time with the results. Now that I'm trying to dig out data on the results, I'm running into trouble and could use some help.
In a nutshell, @test_files is an array of .t test files, all using Test::More or Test::Class (and by extension, T::M) to do the test work.
The initial code is simply:
# run tests through Test::Harness
use TAP::Harness;
$ENV{PERL_TEST_HARNESS_DUMP_TAP} = $output_dir;
my $harness = TAP::Harness->new( { verbosity => $v, lib => \@INC } );
# returns a TAP::Parser::Aggregator object
my $aggregate = $harness->runtests(@test_files);
That runs fine, and $aggregate has the general stats on the run.
My problem is digging into the actual results.
@parsers = $aggregate->parsers();
my $p = $parsers[0];
while (my $res = $p->next) {
# examine results here
}
That doesn't work - while I get parser objects back, it never creates result objects properly - $p->next() always returns undef, regardless of how many tests were run under that parser.
What am I doing wrong here?
Thank you,
Peter
PS - is this the best forum to investigate this, or is there a better location? |