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   15763 use strict;
  2         5  
  2         50  
4 2     2   10 use warnings;
  2         4  
  2         51  
5 2     2   714 use parent qw(TAP::Harness::Restricted);
  2         519  
  2         10  
6              
7             our $VERSION = '0.02';
8              
9             sub new {
10 1     1 1 12 my $class = shift;
11 1         14 my $self = $class->SUPER::new(@_);
12              
13             $self->callback(made_parser => sub {
14 3     3   58318 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         35 my $failure;
19             $parser->callback(test => sub {
20 12         16896 my $test = shift;
21 12 100       59 $self->_bailout($failure) if $failure;
22 10 100       64 $failure = $test unless $test->is_ok;
23 3         68 });
24 1         11243 });
25              
26 1         24 return $self;
27             }
28              
29             1;
30              
31              
32             __END__