File Coverage

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