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