line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Hub::Interceptor; |
2
|
246
|
|
|
246
|
|
2391
|
use strict; |
|
246
|
|
|
|
|
505
|
|
|
246
|
|
|
|
|
7121
|
|
3
|
246
|
|
|
246
|
|
1537
|
use warnings; |
|
246
|
|
|
|
|
469
|
|
|
246
|
|
|
|
|
9608
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.302180'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
246
|
|
|
246
|
|
102110
|
use Test2::Hub::Interceptor::Terminator(); |
|
246
|
|
|
|
|
685
|
|
|
246
|
|
|
|
|
9099
|
|
9
|
|
|
|
|
|
|
|
10
|
246
|
|
|
246
|
|
1611
|
BEGIN { require Test2::Hub; our @ISA = qw(Test2::Hub) } |
|
246
|
|
|
|
|
8815
|
|
11
|
246
|
|
|
246
|
|
1529
|
use Test2::Util::HashBase; |
|
246
|
|
|
|
|
499
|
|
|
246
|
|
|
|
|
1509
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub init { |
14
|
65
|
|
|
65
|
0
|
160
|
my $self = shift; |
15
|
65
|
|
|
|
|
488
|
$self->SUPER::init(); |
16
|
65
|
|
|
|
|
213
|
$self->{+NESTED} = 0; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub inherit { |
20
|
64
|
|
|
64
|
0
|
161
|
my $self = shift; |
21
|
64
|
|
|
|
|
194
|
my ($from, %params) = @_; |
22
|
|
|
|
|
|
|
|
23
|
64
|
|
|
|
|
180
|
$self->{+NESTED} = 0; |
24
|
|
|
|
|
|
|
|
25
|
64
|
50
|
66
|
|
|
386
|
if ($from->{+IPC} && !$self->{+IPC} && !exists($params{ipc})) { |
|
|
|
33
|
|
|
|
|
26
|
0
|
|
|
|
|
0
|
my $ipc = $from->{+IPC}; |
27
|
0
|
|
|
|
|
0
|
$self->{+IPC} = $ipc; |
28
|
0
|
|
|
|
|
0
|
$ipc->add_hub($self->{+HID}); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
64
|
100
|
|
|
|
238
|
if (my $ls = $from->{+_LISTENERS}) { |
32
|
12
|
|
|
|
|
20
|
push @{$self->{+_LISTENERS}} => grep { $_->{intercept_inherit} } @$ls; |
|
12
|
|
|
|
|
33
|
|
|
12
|
|
|
|
|
64
|
|
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
64
|
100
|
|
|
|
235
|
if (my $pfs = $from->{+_PRE_FILTERS}) { |
36
|
23
|
|
|
|
|
44
|
push @{$self->{+_PRE_FILTERS}} => grep { $_->{intercept_inherit} } @$pfs; |
|
23
|
|
|
|
|
91
|
|
|
23
|
|
|
|
|
102
|
|
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
64
|
50
|
|
|
|
316
|
if (my $fs = $from->{+_FILTERS}) { |
40
|
0
|
|
|
|
|
0
|
push @{$self->{+_FILTERS}} => grep { $_->{intercept_inherit} } @$fs; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub clean_inherited { |
45
|
64
|
|
|
64
|
0
|
136
|
my $self = shift; |
46
|
64
|
|
|
|
|
244
|
my %params = @_; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my @sets = ( |
49
|
|
|
|
|
|
|
$self->{+_LISTENERS}, |
50
|
|
|
|
|
|
|
$self->{+_PRE_FILTERS}, |
51
|
64
|
|
|
|
|
223
|
$self->{+_FILTERS}, |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
|
54
|
64
|
|
|
|
|
186
|
for my $set (@sets) { |
55
|
192
|
100
|
|
|
|
517
|
next unless $set; |
56
|
|
|
|
|
|
|
|
57
|
87
|
|
|
|
|
201
|
for my $i (@$set) { |
58
|
87
|
100
|
|
|
|
323
|
my $cbs = $i->{intercept_inherit} or next; |
59
|
23
|
50
|
|
|
|
90
|
next unless ref($cbs) eq 'HASH'; |
60
|
23
|
50
|
|
|
|
82
|
my $cb = $cbs->{clean} or next; |
61
|
23
|
|
|
|
|
106
|
$cb->(%params); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub restore_inherited { |
67
|
63
|
|
|
63
|
0
|
143
|
my $self = shift; |
68
|
63
|
|
|
|
|
243
|
my %params = @_; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
my @sets = ( |
71
|
|
|
|
|
|
|
$self->{+_FILTERS}, |
72
|
|
|
|
|
|
|
$self->{+_PRE_FILTERS}, |
73
|
63
|
|
|
|
|
236
|
$self->{+_LISTENERS}, |
74
|
|
|
|
|
|
|
); |
75
|
|
|
|
|
|
|
|
76
|
63
|
|
|
|
|
490
|
for my $set (@sets) { |
77
|
189
|
100
|
|
|
|
451
|
next unless $set; |
78
|
|
|
|
|
|
|
|
79
|
88
|
|
|
|
|
224
|
for my $i (@$set) { |
80
|
89
|
100
|
|
|
|
449
|
my $cbs = $i->{intercept_inherit} or next; |
81
|
25
|
50
|
|
|
|
99
|
next unless ref($cbs) eq 'HASH'; |
82
|
25
|
50
|
|
|
|
80
|
my $cb = $cbs->{restore} or next; |
83
|
25
|
|
|
|
|
536
|
$cb->(%params); |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub terminate { |
89
|
9
|
|
|
9
|
0
|
22
|
my $self = shift; |
90
|
9
|
|
|
|
|
23
|
my ($code) = @_; |
91
|
|
|
|
|
|
|
|
92
|
9
|
|
|
|
|
22
|
eval { |
93
|
246
|
|
|
246
|
|
2086
|
no warnings 'exiting'; |
|
246
|
|
|
|
|
622
|
|
|
246
|
|
|
|
|
21506
|
|
94
|
9
|
|
|
|
|
84
|
last T2_SUBTEST_WRAPPER; |
95
|
|
|
|
|
|
|
}; |
96
|
1
|
|
|
|
|
2
|
my $err = $@; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
# Fallback |
99
|
1
|
|
|
|
|
8
|
die bless(\$err, 'Test2::Hub::Interceptor::Terminator'); |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
1; |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
__END__ |