line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Event::Bail; |
2
|
107
|
|
|
107
|
|
1104
|
use strict; |
|
107
|
|
|
|
|
642
|
|
|
107
|
|
|
|
|
2696
|
|
3
|
107
|
|
|
107
|
|
547
|
use warnings; |
|
107
|
|
|
|
|
190
|
|
|
107
|
|
|
|
|
2926
|
|
4
|
|
|
|
|
|
|
|
5
|
107
|
|
|
107
|
|
526
|
use Test::Stream::Formatter::TAP qw/OUT_STD/; |
|
107
|
|
|
|
|
190
|
|
|
107
|
|
|
|
|
729
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Test::Stream::Event( |
8
|
107
|
|
|
|
|
732
|
accessors => [qw/reason/], |
9
|
107
|
|
|
107
|
|
592
|
); |
|
107
|
|
|
|
|
185
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub to_tap { |
12
|
2
|
|
|
2
|
1
|
5
|
my $self = shift; |
13
|
|
|
|
|
|
|
return [ |
14
|
2
|
|
|
|
|
13
|
OUT_STD, |
15
|
|
|
|
|
|
|
"Bail out! " . $self->reason . "\n", |
16
|
|
|
|
|
|
|
]; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub update_state { |
20
|
11
|
|
|
11
|
1
|
28
|
my $self = shift; |
21
|
11
|
|
|
|
|
23
|
my ($state) = @_; |
22
|
|
|
|
|
|
|
|
23
|
11
|
|
|
|
|
60
|
$state->set_bailed_out($self); |
24
|
11
|
|
|
|
|
101
|
$state->bump_fail; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# Make sure the tests terminate |
28
|
11
|
|
|
11
|
1
|
38
|
sub terminate { 255 }; |
29
|
|
|
|
|
|
|
|
30
|
11
|
|
|
11
|
1
|
42
|
sub global { 1 }; |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
1
|
1
|
11
|
sub causes_fail { 1 } |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |