I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2008-11-03 19:14:57-08 by peterleonard
TAP::Harness, the aggregator, the parser, and results
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?
Direct Responses: 11216 | Write a response