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