In a (little weird) testing environment frequently test scripts die. I'm collecting some statistics via
TAP::Parser::Aggregator, and I can retrieve every information that I want - except the number of planned tests. How can I get this information?
So far I couldn't find anything in the documentation, and $aggregator->total returns only the number of run tests, not the number of planed tests.
I don't really think it matters here, but since I always preach to others to supply some code, I'll show you my code so far:
use strict;
use warnings;
use TAP::Harness;
use TAP::Parser::Aggregator 3.01;
#...
sub get_harness {
return TAP::Harness->new({
verbosity => -2,
exec => ['../../parrot', '-G', 'perl6.pbc'],
merge => 1,
});
}
# ...
# find a file to process, which will be stored in $test:
my $H = get_harness();
my $agg = TAP::Parser::Aggregator->new();
$agg->start();
$H->aggregate_tests($agg, $test);
$agg->stop();
my $actually_passed = $agg->passed - $agg->skipped - $agg->todo;
# more statistics collection here...
Update: I contacted Andy Armstrong via IRC, and he now added a planned() method to the aggregator class, which will be included in the next release. I love open source - contact the library authors, and get your problems fixed ;-)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.