line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Plugin::IPC; |
2
|
97
|
|
|
97
|
|
678
|
use strict; |
|
97
|
|
|
|
|
96
|
|
|
97
|
|
|
|
|
2240
|
|
3
|
97
|
|
|
97
|
|
289
|
use warnings; |
|
97
|
|
|
|
|
95
|
|
|
97
|
|
|
|
|
1648
|
|
4
|
|
|
|
|
|
|
|
5
|
97
|
|
|
97
|
|
30160
|
use Test::Stream::IPC(); |
|
97
|
|
|
|
|
147
|
|
|
97
|
|
|
|
|
1648
|
|
6
|
|
|
|
|
|
|
|
7
|
97
|
|
|
97
|
|
36867
|
use Test::Stream::Context qw/context/; |
|
97
|
|
|
|
|
204
|
|
|
97
|
|
|
|
|
499
|
|
8
|
97
|
|
|
97
|
|
501
|
use Test::Stream::Util qw/pkg_to_file/; |
|
97
|
|
|
|
|
133
|
|
|
97
|
|
|
|
|
325
|
|
9
|
97
|
|
|
97
|
|
379
|
use Carp qw/croak confess/; |
|
97
|
|
|
|
|
136
|
|
|
97
|
|
|
|
|
4810
|
|
10
|
|
|
|
|
|
|
|
11
|
97
|
|
|
97
|
|
35848
|
use Test::Stream::Plugin qw/import/; |
|
97
|
|
|
|
|
159
|
|
|
97
|
|
|
|
|
259
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub load_ts_plugin { |
14
|
121
|
|
|
121
|
0
|
184
|
my $class = shift; |
15
|
121
|
|
|
|
|
135
|
my $caller = shift; |
16
|
|
|
|
|
|
|
|
17
|
121
|
|
|
|
|
135
|
my @drivers; |
18
|
|
|
|
|
|
|
my %params; |
19
|
|
|
|
|
|
|
|
20
|
121
|
|
|
|
|
258
|
for my $arg (@_) { |
21
|
8
|
100
|
|
|
|
27
|
if ($arg =~ m/^-(.*)$/) { |
|
|
100
|
|
|
|
|
|
22
|
5
|
|
|
|
|
16
|
$params{$1}++; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
elsif ($arg =~ m/^\+(.+)$/) { |
25
|
1
|
|
|
|
|
3
|
push @drivers => $1; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
else { |
28
|
2
|
|
|
|
|
5
|
push @drivers => "Test::Stream::IPC::$arg"; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
121
|
|
|
|
|
168
|
for my $driver (@drivers) { |
33
|
3
|
|
|
|
|
14
|
my $file = pkg_to_file($driver); |
34
|
3
|
100
|
|
|
|
3
|
unless(eval { require $file; 1 }) { |
|
3
|
|
|
|
|
18
|
|
|
1
|
|
|
|
|
242
|
|
35
|
2
|
|
|
|
|
135
|
my $error = $@; |
36
|
2
|
50
|
|
|
|
8
|
die $error unless $error =~ m/^Can't locate/; |
37
|
2
|
|
|
|
|
6
|
next; |
38
|
|
|
|
|
|
|
} |
39
|
1
|
|
|
|
|
5
|
Test::Stream::IPC->register_driver($driver); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
121
|
100
|
|
|
|
326
|
Test::Stream::IPC->enable_polling if delete $params{poll}; |
43
|
|
|
|
|
|
|
|
44
|
121
|
100
|
|
|
|
294
|
if (delete $params{cull}) { |
45
|
97
|
|
|
97
|
|
516
|
no strict 'refs'; |
|
97
|
|
|
|
|
131
|
|
|
97
|
|
|
|
|
12578
|
|
46
|
3
|
|
|
|
|
9
|
*{"$caller->[0]\::cull"} = \&cull |
|
3
|
|
|
|
|
33
|
|
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
121
|
100
|
|
|
|
773
|
if (my @bad = keys %params) { |
50
|
1
|
|
|
|
|
2
|
confess "Invalid parameters: " . join ', ', map { "'-$_'" } @bad; |
|
1
|
|
|
|
|
155
|
|
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub cull { |
55
|
1
|
|
|
1
|
0
|
4
|
my $ctx = context(); |
56
|
1
|
|
|
|
|
4
|
$ctx->hub->cull; |
57
|
1
|
|
|
|
|
4
|
$ctx->release; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
__END__ |