1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
4 .\" ========================================================================
5 .de Sh \" Subsection heading
13 .de Sp \" Vertical space (when we can't use .PP)
17 .de Vb \" Begin verbatim text
22 .de Ve \" End verbatim text
26 .\" Set up some character translations and predefined strings. \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote. | will give a
29 .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30 .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31 .\" expand to `' in nroff, nothing in troff, for use with C<>.
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
37 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD. Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
57 . tm Index:\\$1\t\\n%\t"\\$2"
63 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
64 .\" way too many mistakes in technical documents.
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear. Run. Save yourself. No user-serviceable parts.
70 . \" fudge factors for nroff and troff
79 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
85 . \" simple accents for nroff and troff
95 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
102 . \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 . \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 . \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
129 .\" ========================================================================
131 .IX Title "TAP::Parser::Aggregator 3"
132 .TH TAP::Parser::Aggregator 3 "2009-05-05" "perl v5.8.7" "User Contributed Perl Documentation"
134 TAP::Parser::Aggregator \- Aggregate TAP::Parser results
139 .IX Header "SYNOPSIS"
141 \& use TAP::Parser::Aggregator;
145 \& my $aggregate = TAP::Parser::Aggregator\->new;
146 \& $aggregate\->add( 't/00\-load.t', $load_parser );
147 \& $aggregate\->add( 't/10\-lex.t', $lex_parser );
151 \& my $summary = <<'END_SUMMARY';
154 \& Unexpectedly succeeded: %s
157 \& scalar $aggregate\->passed,
158 \& scalar $aggregate\->failed,
159 \& scalar $aggregate\->todo_passed;
162 .IX Header "DESCRIPTION"
163 \&\f(CW\*(C`TAP::Parser::Aggregator\*(C'\fR collects parser objects and allows
164 reporting/querying their aggregate results.
168 .IX Subsection "Class Methods"
169 \fI\f(CI\*(C`new\*(C'\fI\fR
173 \& my $aggregate = TAP::Parser::Aggregator\->new;
176 Returns a new \f(CW\*(C`TAP::Parser::Aggregator\*(C'\fR object.
177 .Sh "Instance Methods"
178 .IX Subsection "Instance Methods"
179 \fI\f(CI\*(C`add\*(C'\fI\fR
183 \& $aggregate\->add( $description => $parser );
186 The \f(CW$description\fR is usually a test file name (but only by
187 convention.) It is used as a unique identifier (see e.g.
188 \&\*(L"parsers\*(R".) Reusing a description is a fatal error.
190 The \f(CW$parser\fR is a TAP::Parser object.
192 \fI\f(CI\*(C`parsers\*(C'\fI\fR
193 .IX Subsection "parsers"
196 \& my $count = $aggregate\->parsers;
197 \& my @parsers = $aggregate\->parsers;
198 \& my @parsers = $aggregate\->parsers(@descriptions);
201 In scalar context without arguments, this method returns the number of parsers
202 aggregated. In list context without arguments, returns the parsers in the
203 order they were added.
205 If \f(CW@descriptions\fR is given, these correspond to the keys used in each
206 call to the \fIadd()\fR method. Returns an array of the requested parsers (in
207 the requested order) in list context or an array reference in scalar
210 Requesting an unknown identifier is a fatal error.
212 \fI\f(CI\*(C`descriptions\*(C'\fI\fR
213 .IX Subsection "descriptions"
215 Get an array of descriptions in the order in which they were added to
218 \fI\f(CI\*(C`start\*(C'\fI\fR
219 .IX Subsection "start"
221 Call \f(CW\*(C`start\*(C'\fR immediately before adding any results to the aggregator.
222 Among other times it records the start time for the test run.
224 \fI\f(CI\*(C`stop\*(C'\fI\fR
225 .IX Subsection "stop"
227 Call \f(CW\*(C`stop\*(C'\fR immediately after adding all test results to the aggregator.
229 \fI\f(CI\*(C`elapsed\*(C'\fI\fR
230 .IX Subsection "elapsed"
232 Elapsed returns a Benchmark object that represents the running time
233 of the aggregated tests. In order for \f(CW\*(C`elapsed\*(C'\fR to be valid you must
234 call \f(CW\*(C`start\*(C'\fR before running the tests and \f(CW\*(C`stop\*(C'\fR immediately
237 \fI\f(CI\*(C`elapsed_timestr\*(C'\fI\fR
238 .IX Subsection "elapsed_timestr"
240 Returns a formatted string representing the runtime returned by
241 \&\f(CW\*(C`elapsed()\*(C'\fR. This lets the caller not worry about Benchmark.
243 \fI\f(CI\*(C`all_passed\*(C'\fI\fR
244 .IX Subsection "all_passed"
246 Return true if all the tests passed and no parse errors were detected.
248 \fI\f(CI\*(C`get_status\*(C'\fI\fR
249 .IX Subsection "get_status"
251 Get a single word describing the status of the aggregated tests.
252 Depending on the outcome of the tests returns '\s-1PASS\s0', '\s-1FAIL\s0' or
253 \&'\s-1NOTESTS\s0'. This token is understood by CPAN::Reporter.
254 .Sh "Summary methods"
255 .IX Subsection "Summary methods"
256 Each of the following methods will return the total number of corresponding
257 tests if called in scalar context. If called in list context, returns the
258 descriptions of the parsers which contain the corresponding tests (see \f(CW\*(C`add\*(C'\fR
259 for an explanation of description.
263 .IP "* parse_errors" 4
264 .IX Item "parse_errors"
273 .IP "* todo_passed" 4
274 .IX Item "todo_passed"
281 For example, to find out how many tests unexpectedly succeeded (\s-1TODO\s0 tests
282 which passed when they shouldn't):
285 \& my $count = $aggregate\->todo_passed;
286 \& my @descriptions = $aggregate\->todo_passed;
289 Note that \f(CW\*(C`wait\*(C'\fR and \f(CW\*(C`exit\*(C'\fR are the totals of the wait and exit
290 statuses of each of the tests. These values are totalled only to provide
291 a true value if any of them are non\-zero.
293 \fI\f(CI\*(C`total\*(C'\fI\fR
294 .IX Subsection "total"
297 \& my $tests_run = $aggregate\->total;
300 Returns the total number of tests run.
302 \fI\f(CI\*(C`has_problems\*(C'\fI\fR
303 .IX Subsection "has_problems"
306 \& if ( $parser\->has_problems ) {
311 Identical to \f(CW\*(C`has_errors\*(C'\fR, but also returns true if any \s-1TODO\s0 tests
312 unexpectedly succeeded. This is more akin to \*(L"warnings\*(R".
314 \fI\f(CI\*(C`has_errors\*(C'\fI\fR
315 .IX Subsection "has_errors"
318 \& if ( $parser\->has_errors ) {
323 Returns true if \fIany\fR of the parsers failed. This includes:
324 .IP "* Failed tests" 4
325 .IX Item "Failed tests"
327 .IP "* Parse errors" 4
328 .IX Item "Parse errors"
329 .IP "* Bad exit or wait status" 4
330 .IX Item "Bad exit or wait status"
333 \fI\f(CI\*(C`todo_failed\*(C'\fI\fR
334 .IX Subsection "todo_failed"
337 \& # deprecated in favor of 'todo_passed'. This method was horribly misnamed.
340 This was a badly misnamed method. It indicates which \s-1TODO\s0 tests unexpectedly
341 succeeded. Will now issue a warning and call \f(CW\*(C`todo_passed\*(C'\fR.
343 .IX Header "See Also"