line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Plugin::IOEvents; |
2
|
1
|
|
|
1
|
|
6392
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
62
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000002'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
468
|
use Test2::Plugin::IOEvents::Tie; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
8
|
1
|
|
|
1
|
|
6
|
use Test2::API qw/ test2_add_callback_post_load /; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
118
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $LOADED = 0; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub import { |
13
|
1
|
|
|
1
|
|
9
|
my $class = shift; |
14
|
|
|
|
|
|
|
|
15
|
1
|
50
|
|
|
|
5
|
return if $LOADED++; # do not add multiple hooks |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
test2_add_callback_post_load(sub { |
18
|
1
|
|
|
1
|
|
34
|
tie(*STDOUT, 'Test2::Plugin::IOEvents::Tie', 'STDOUT'); |
19
|
1
|
|
|
|
|
4
|
tie(*STDERR, 'Test2::Plugin::IOEvents::Tie', 'STDERR'); |
20
|
1
|
|
|
|
|
6
|
}); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |