Lines Matching refs:agg

49 my $agg = TAP::Parser::Aggregator->new;
50 isa_ok $agg, 'TAP::Parser::Aggregator';
52 can_ok $agg, 'add';
53 ok $agg->add( 'tap1', $parser1 ), '... and calling it should succeed';
54 ok $agg->add( 'tap2', $parser2 ), '... even if we add more than one parser';
55 eval { $agg->add( 'tap1', $parser1 ) };
59 can_ok $agg, 'parsers';
60 is scalar $agg->parsers, 2,
62 is_deeply [ $agg->parsers ], [ $parser1, $parser2 ],
64 is_deeply $agg->parsers('tap2'), $parser2, '... or reporting a single parser';
65 is_deeply [ $agg->parsers(qw(tap2 tap1)) ], [ $parser2, $parser1 ],
70 can_ok $agg, 'passed';
71 is $agg->passed, 10,
73 is_deeply [ $agg->passed ], [qw(tap1 tap2)],
76 can_ok $agg, 'failed';
77 is $agg->failed, 2,
79 is_deeply [ $agg->failed ], [qw(tap1 tap2)],
82 can_ok $agg, 'todo';
83 is $agg->todo, 4, '... and we should have the correct number of todo tests';
84 is_deeply [ $agg->todo ], [qw(tap1 tap2)],
87 can_ok $agg, 'skipped';
88 is $agg->skipped, 1,
90 is_deeply [ $agg->skipped ], [qw(tap1)],
93 can_ok $agg, 'parse_errors';
94 is $agg->parse_errors, 0, '... and the correct number of parse errors';
95 is_deeply [ $agg->parse_errors ], [],
98 can_ok $agg, 'todo_passed';
99 is $agg->todo_passed, 1,
101 is_deeply [ $agg->todo_passed ], [qw(tap2)],
104 can_ok $agg, 'total';
105 is $agg->total, $agg->passed + $agg->failed,
108 can_ok $agg, 'planned';
109 is $agg->planned, $agg->passed + $agg->failed,
112 can_ok $agg, 'has_problems';
113 ok $agg->has_problems, '... and it should report true if there are problems';
115 can_ok $agg, 'has_errors';
116 ok $agg->has_errors, '... and it should report true if there are errors';
118 can_ok $agg, 'get_status';
119 is $agg->get_status, 'FAIL', '... and it should tell us the tests failed';
121 can_ok $agg, 'all_passed';
122 ok !$agg->all_passed, '... and it should tell us not all tests passed';
128 # currently the $agg object has descriptions tap1 and tap2
130 # $agg will call its _croak method
136 $agg->_get_parsers('no_such_parser_for');
147 my $gp = $agg->_get_parsers(qw(tap1 tap2))
163 $agg->todo_failed();
192 $agg = TAP::Parser::Aggregator->new();
193 isa_ok $agg, 'TAP::Parser::Aggregator';
204 $agg->add( 'tap3', $parser3 );
206 is $agg->passed, 1,
208 is $agg->failed, 0,
210 is $agg->todo_passed, 1,
212 ok $agg->has_problems,
214 is $agg->get_status, 'PASS', '... and the status should be passing';
215 ok !$agg->has_errors, '.... but it should not report any errors';
216 ok $agg->all_passed, '... bonus tests should be passing tests, too';
220 $agg = TAP::Parser::Aggregator->new();
230 $agg->add( 'tap4', $parser4 );
232 is $agg->passed, 0,
234 is $agg->failed, 0,
236 is $agg->todo_passed, 0,
238 is $agg->parse_errors, 1, '... and the correct number of parse errors';
239 ok $agg->has_problems,
245 # so we'll get a little funky with $agg and push exit and wait descriptions
248 $agg = TAP::Parser::Aggregator->new();
258 $agg->add( 'tap', $parser5 );
260 push @{ $agg->{descriptions_for_exit} }, 'one possible reason';
261 $agg->{exit}++;
263 is $agg->passed, 1,
265 is $agg->failed, 0,
267 is $agg->todo_passed, 0,
269 is $agg->parse_errors, 0, '... and the correct number of parse errors';
271 my @exits = $agg->exit;
277 ok $agg->has_problems,
282 $agg = TAP::Parser::Aggregator->new();
284 $agg->add( 'tap', $parser5 );
286 push @{ $agg->{descriptions_for_wait} }, 'another possible reason';
287 $agg->{wait}++;
289 is $agg->passed, 1,
291 is $agg->failed, 0,
293 is $agg->todo_passed, 0,
295 is $agg->parse_errors, 0, '... and the correct number of parse errors';
296 is $agg->exit, 0, '... and the correct number of exits';
298 my @waits = $agg->wait;
304 ok $agg->has_problems,