Branch Coverage

blib/lib/Test2/Harness/Renderer/EventStream.pm
Criterion Covered Total %
branch 181 208 87.0


line true false branch
53 0 0 if -t STDOUT
54 0 0 if -t STDERR
61 0 23 if -t STDOUT
62 0 23 if -t STDERR
72 0 84 unless open my $out, '>&', 'STDOUT'
84 0 46 $is_term ? :
46 54 unless defined $self->{'color'}
85 0 96 $is_term ? :
96 4 unless defined $self->{'watch'}
86 0 100 if ($is_term || $self->{'color'} || $self->{'watch'} and $^O eq 'MSWin32')
87 0 0 if eval { do { require Win32::Console::ANSI } }
92 2 98 $self->{'color'} ? :
0 100 $self->{'color'} > 1 ? :
95 2 98 $self->{'color'} ? :
98 0 16 unless eval { do { Term::ANSIColor::color($_) } }
109 2 878 if ($self->{'clear'})
115 8502 14052 unless (ref $i)
121 13996 56 if @$i < 3
122 2134 11918 if ($c =~ /^\d+$/) { }
123 16 2118 if @$graph
129 13996 56 if $r
145 323 0 if ($enc =~ /^utf-?8$/i) { }
159 2 24 if (@fail) { }
184 611 2 unless defined $slots->[$s]
185 611 2 if defined $slot
211 323 19410 if $event->isa('Test2::Event::Encoding')
220 16 19176 if $n < 0
222 4973 14203 if ($n == 0)
223 2971 2002 unless $event->subtest_id
224 1994 8 unless $event->in_subtest
227 8 14203 unless $event->in_subtest
228 8 14195 if $self->{'watch'}
244 603 19134 if ($event->isa('Test2::Event::ProcessStart') and not $self->{'verbose'}) { }
249 824 18310 if @to_print
254 603 19134 if $is_end
262 14187 4949 unless my $meth = $self->pick_renderer($event)
263 4123 826 unless my(@to_print) = $self->$meth($j, $event)
264 605 221 $job->{'start'} ? :
266 221 605 unless $is_end
268 603 2 unless my(@errors) = $self->_plan_errors($event->result->events, 0)
283 19733 4 unless $self->{'watch'}
284 2 2 if $self->{'verbose'}
298 4 21268 if $event->no_display
300 1206 20062 if $event->isa('Test2::Event::ProcessStart')
303 605 19457 if ($event->isa('Test2::Event::ParserSelect'))
304 603 2 unless $self->{'verbose'}
308 2061 17396 if ($event->isa('Test2::Event::Subtest'))
309 4 2057 if $event->causes_fail
312 2039 18 unless $self->{'verbose'} or $n < 0
315 4 14 if ($plan and $plan->directive and $plan->directive eq 'SKIP')
322 1202 16194 if ($event->isa('Test2::Event::ProcessFinish'))
323 1202 0 if $event->result->passed
327 2650 13544 if ($event->isa('Test2::Event::Plan'))
328 2640 10 unless $self->{'verbose'}
332 325 13219 if ($event->isa('Test2::Event::Encoding'))
333 323 2 unless $self->{'verbose'}
337 8 13211 if ($event->isa('Test2::Event::UnknownStdout') or $event->isa('Test2::Event::UnknownStderr'))
338 0 8 unless defined $event->output
340 4 4 if $event->isa('Test2::Event::UnknownStderr')
341 0 4 if $event->diagnostics
343 2 2 unless $self->{'verbose'}
347 132 13079 if ($event->isa('Test2::Event::UnexpectedProcessExit') or $event->isa('Test2::Event::TimeoutReset'))
351 12349 730 if ($event->increments_count)
352 24 12325 if ($self->{'verbose'})
353 2 22 if $event->can('reason') and defined $event->reason
354 2 20 if $event->can('todo') and defined $event->todo
357 0 20 if not $event->pass and $event->effective_pass
358 16 4 unless $event->causes_fail
361 8 12321 if $event->causes_fail
365 710 20 if ($event->can('message'))
366 306 404 if $event->diagnostics
367 402 2 unless $self->{'verbose'}
371 6 14 unless $self->{'verbose'} or $event->diagnostics
372 4 10 if $event->isa('Test2::Event::ParseError')
374 2 8 unless defined $event->summary and $event->summary =~ /\S/
385 18312 1439 unless $val
399 2 3484 if (not $event) { }
404 603 2881 if $event->isa('Test2::Event::ProcessStart')
405 2 3482 if $event->isa('Test2::Event::Subtest') and $n < 0
406 601 2883 if $event->isa('Test2::Event::ProcessFinish')
414 12 3492 unless (defined $s)
419 10 3482 unless ($jobs->{$s}{'counter'} > 1 or $j == $s)
424 3466 16 if ($s == $j and $mark ne '|') { }
425 2260 1206 $mark eq '+' ? :
437 5734 2874 ref $_ ? :
450 3279 0 if defined $_
451 0 1439 unless @lines
457 51 1388 if (grep {$term_size <= $len + length($_);} @lines) { }
479 18312 1437 unless my(@tag) = $self->tag($event)
487 51 1386 if @$blob
497 2 4 unless my(@tag) = $self->tag($event)
505 2 2 if @$blob
515 2 4 unless my(@tag) = $self->tag($event)
537 53 14146 if ($e->subtest_id) { }
548 2041 12158 if (not @todo or ($todo[0]->in_subtest || '') ne ($e->in_subtest || '') and not $e->subtest_id) { }
553 2041 0 if (my $st = pop @stack)
563 4 0 if (@out and $self->{'verbose'})
587 0 2642 unless ($nested or grep {$_->isa('Test2::Event::ProcessStart');} @{$events;})
592 19140 14187 if ($_->nested || 0) == $nested
594 0 2642 unless (@plans)
599 0 2642 if @plans > 1
602 22 2620 unless $plans[0] == $events->[0] or $plans[0] == $events->[-1]
607 19140 14187 if ($_->nested || 0) == $nested
608 2642 0 if $max == $total