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         2  
  1         23  
3 1     1   5 use warnings;
  1         2  
  1         25  
4              
5 1     1   6 use Test::Stream::Plugin;
  1         2  
  1         7  
6 1     1   5 use Test::Stream::Context;
  1         2  
  1         6  
7              
8             my $LOADED = 0;
9             sub load_ts_plugin {
10 1     1 0 3 my $class = shift;
11 1         2 my $caller = shift;
12 1 50       4 return if $LOADED++;
13              
14             Test::Stream::Context->ON_RELEASE(sub {
15 9     9   13 my $ctx = shift;
16 9 100       28 return if $ctx->hub->state->is_passing;
17 2         8 $ctx->bail("(Bail On Fail)");
18 1         10 });
19             }
20              
21             1;
22              
23             __END__