line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Plugin::IOEvents; |
2
|
1
|
|
|
1
|
|
6556
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
44
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.001000'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
491
|
use Test2::Plugin::IOEvents::Tie; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
68
|
|
8
|
1
|
|
|
1
|
|
8
|
use Test2::API qw/ test2_add_callback_post_load /; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
121
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $LOADED = 0; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub import { |
13
|
1
|
|
|
1
|
|
10
|
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
|
|
29
|
tie(*STDOUT, 'Test2::Plugin::IOEvents::Tie', 'STDOUT'); |
19
|
1
|
|
|
|
|
4
|
tie(*STDERR, 'Test2::Plugin::IOEvents::Tie', 'STDERR'); |
20
|
1
|
|
|
|
|
7
|
}); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |