line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Hub::Interceptor; |
2
|
246
|
|
|
246
|
|
2083
|
use strict; |
|
246
|
|
|
|
|
494
|
|
|
246
|
|
|
|
|
7190
|
|
3
|
246
|
|
|
246
|
|
1183
|
use warnings; |
|
246
|
|
|
|
|
471
|
|
|
246
|
|
|
|
|
9419
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.302181'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
246
|
|
|
246
|
|
102593
|
use Test2::Hub::Interceptor::Terminator(); |
|
246
|
|
|
|
|
638
|
|
|
246
|
|
|
|
|
8943
|
|
9
|
|
|
|
|
|
|
|
10
|
246
|
|
|
246
|
|
1874
|
BEGIN { require Test2::Hub; our @ISA = qw(Test2::Hub) } |
|
246
|
|
|
|
|
8764
|
|
11
|
246
|
|
|
246
|
|
1494
|
use Test2::Util::HashBase; |
|
246
|
|
|
|
|
474
|
|
|
246
|
|
|
|
|
1466
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub init { |
14
|
65
|
|
|
65
|
0
|
158
|
my $self = shift; |
15
|
65
|
|
|
|
|
425
|
$self->SUPER::init(); |
16
|
65
|
|
|
|
|
217
|
$self->{+NESTED} = 0; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub inherit { |
20
|
64
|
|
|
64
|
0
|
143
|
my $self = shift; |
21
|
64
|
|
|
|
|
203
|
my ($from, %params) = @_; |
22
|
|
|
|
|
|
|
|
23
|
64
|
|
|
|
|
156
|
$self->{+NESTED} = 0; |
24
|
|
|
|
|
|
|
|
25
|
64
|
50
|
66
|
|
|
310
|
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
|
|
|
|
244
|
if (my $ls = $from->{+_LISTENERS}) { |
32
|
12
|
|
|
|
|
16
|
push @{$self->{+_LISTENERS}} => grep { $_->{intercept_inherit} } @$ls; |
|
12
|
|
|
|
|
33
|
|
|
12
|
|
|
|
|
33
|
|
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
64
|
100
|
|
|
|
244
|
if (my $pfs = $from->{+_PRE_FILTERS}) { |
36
|
23
|
|
|
|
|
46
|
push @{$self->{+_PRE_FILTERS}} => grep { $_->{intercept_inherit} } @$pfs; |
|
23
|
|
|
|
|
85
|
|
|
23
|
|
|
|
|
75
|
|
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
64
|
50
|
|
|
|
333
|
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
|
138
|
my $self = shift; |
46
|
64
|
|
|
|
|
252
|
my %params = @_; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my @sets = ( |
49
|
|
|
|
|
|
|
$self->{+_LISTENERS}, |
50
|
|
|
|
|
|
|
$self->{+_PRE_FILTERS}, |
51
|
64
|
|
|
|
|
242
|
$self->{+_FILTERS}, |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
|
54
|
64
|
|
|
|
|
185
|
for my $set (@sets) { |
55
|
192
|
100
|
|
|
|
524
|
next unless $set; |
56
|
|
|
|
|
|
|
|
57
|
87
|
|
|
|
|
191
|
for my $i (@$set) { |
58
|
87
|
100
|
|
|
|
303
|
my $cbs = $i->{intercept_inherit} or next; |
59
|
23
|
50
|
|
|
|
86
|
next unless ref($cbs) eq 'HASH'; |
60
|
23
|
50
|
|
|
|
77
|
my $cb = $cbs->{clean} or next; |
61
|
23
|
|
|
|
|
109
|
$cb->(%params); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub restore_inherited { |
67
|
63
|
|
|
63
|
0
|
169
|
my $self = shift; |
68
|
63
|
|
|
|
|
240
|
my %params = @_; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
my @sets = ( |
71
|
|
|
|
|
|
|
$self->{+_FILTERS}, |
72
|
|
|
|
|
|
|
$self->{+_PRE_FILTERS}, |
73
|
63
|
|
|
|
|
253
|
$self->{+_LISTENERS}, |
74
|
|
|
|
|
|
|
); |
75
|
|
|
|
|
|
|
|
76
|
63
|
|
|
|
|
568
|
for my $set (@sets) { |
77
|
189
|
100
|
|
|
|
526
|
next unless $set; |
78
|
|
|
|
|
|
|
|
79
|
88
|
|
|
|
|
259
|
for my $i (@$set) { |
80
|
89
|
100
|
|
|
|
408
|
my $cbs = $i->{intercept_inherit} or next; |
81
|
25
|
50
|
|
|
|
101
|
next unless ref($cbs) eq 'HASH'; |
82
|
25
|
50
|
|
|
|
83
|
my $cb = $cbs->{restore} or next; |
83
|
25
|
|
|
|
|
479
|
$cb->(%params); |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub terminate { |
89
|
9
|
|
|
9
|
0
|
29
|
my $self = shift; |
90
|
9
|
|
|
|
|
23
|
my ($code) = @_; |
91
|
|
|
|
|
|
|
|
92
|
9
|
|
|
|
|
19
|
eval { |
93
|
246
|
|
|
246
|
|
2138
|
no warnings 'exiting'; |
|
246
|
|
|
|
|
569
|
|
|
246
|
|
|
|
|
21224
|
|
94
|
9
|
|
|
|
|
84
|
last T2_SUBTEST_WRAPPER; |
95
|
|
|
|
|
|
|
}; |
96
|
1
|
|
|
|
|
3
|
my $err = $@; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
# Fallback |
99
|
1
|
|
|
|
|
9
|
die bless(\$err, 'Test2::Hub::Interceptor::Terminator'); |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
1; |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
__END__ |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=pod |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=encoding UTF-8 |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 NAME |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Test2::Hub::Interceptor - Hub used by interceptor to grab results. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 SOURCE |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
The source code repository for Test2 can be found at |
117
|
|
|
|
|
|
|
F<http://github.com/Test-More/test-more/>. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 MAINTAINERS |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=over 4 |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=item Chad Granum E<lt>exodist@cpan.orgE<gt> |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=back |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head1 AUTHORS |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=over 4 |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=item Chad Granum E<lt>exodist@cpan.orgE<gt> |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=back |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=head1 COPYRIGHT |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
Copyright 2020 Chad Granum E<lt>exodist@cpan.orgE<gt>. |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or |
140
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
See F<http://dev.perl.org/licenses/> |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=cut |