File Coverage

blib/lib/TAP/Harness/BailOnFail.pm
Criterion Covered Total %
statement 19 19 100.0
branch 4 4 100.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 29 29 100.0


line stmt bran cond sub pod time code
1             package TAP::Harness::BailOnFail;
2              
3 2     2   15266 use strict;
  2         5  
  2         52  
4 2     2   10 use warnings;
  2         3  
  2         50  
5 2     2   720 use parent qw(TAP::Harness::Restricted);
  2         433  
  2         10  
6              
7             our $VERSION = '0.001';
8              
9             sub new {
10 1     1 1 14 my $class = shift;
11 1         16 my $self = $class->SUPER::new(@_);
12              
13             $self->callback(made_parser => sub {
14 3     3   58674 my $parser = shift;
15              
16             # Continue parsing after the first failure until just before the
17             # next test, to capture any pending diagnositcs.
18 3         34 my $failure;
19             $parser->callback(test => sub {
20 12         18368 my $test = shift;
21 12 100       56 $self->_bailout($failure) if $failure;
22 10 100       26 $failure = $test unless $test->is_ok;
23 3         45 });
24 1         11593 });
25              
26 1         24 return $self;
27             }
28              
29              
30             1;
31              
32              
33             __END__