line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Plugin::Capabilities; |
2
|
2
|
|
|
2
|
|
6
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
45
|
|
3
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
33
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
6
|
use Test::Stream::Capabilities(); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
24
|
|
6
|
2
|
|
|
2
|
|
6
|
use Test::Stream::Plugin qw/import/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
10
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
7
|
use Carp qw/croak/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
225
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub load_ts_plugin { |
11
|
2
|
|
|
2
|
0
|
4
|
my $class = shift; |
12
|
2
|
|
|
|
|
3
|
my ($caller, @args) = @_; |
13
|
|
|
|
|
|
|
|
14
|
2
|
50
|
|
|
|
11
|
@args = (qw/CAN_THREAD CAN_FORK/) unless @args; |
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
|
|
5
|
for my $arg (@args) { |
17
|
4
|
50
|
33
|
|
|
38
|
croak "$arg is not a valid capabilties check" |
18
|
|
|
|
|
|
|
unless $arg =~ m/^CAN_/ && Test::Stream::Capabilities->can($arg); |
19
|
|
|
|
|
|
|
|
20
|
4
|
|
|
|
|
11
|
my $const = Test::Stream::Capabilities::get_const($arg); |
21
|
2
|
|
|
2
|
|
8
|
no strict 'refs'; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
115
|
|
22
|
4
|
|
|
|
|
4
|
*{"$caller->[0]\::$arg"} = $const; |
|
4
|
|
|
|
|
21
|
|
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |