File Coverage

blib/lib/Test/Stream/Plugin/BailOnFail.pm
Criterion Covered Total %
statement 19 19 100.0
branch 3 4 75.0
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 28 30 93.3


line stmt bran cond sub pod time code
1             package Test::Stream::Plugin::BailOnFail;
2 1     1   4 use strict;
  1         1  
  1         23  
3 1     1   3 use warnings;
  1         1  
  1         20  
4              
5 1     1   3 use Test::Stream::Plugin qw/import/;
  1         1  
  1         6  
6 1     1   4 use Test::Stream::Context();
  1         1  
  1         86  
7              
8             my $LOADED = 0;
9             sub load_ts_plugin {
10 1     1 0 2 my $class = shift;
11 1         1 my $caller = shift;
12 1 50       3 return if $LOADED++;
13              
14             Test::Stream::Context->ON_RELEASE(sub {
15 9     9   9 my $ctx = shift;
16 9 100       21 return if $ctx->hub->state->is_passing;
17 2         6 $ctx->bail("(Bail On Fail)");
18 1         9 });
19             }
20              
21             1;
22              
23             __END__