line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::OpenTracing::Interface; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
18
|
|
159
|
use strict; |
|
18
|
|
|
|
|
36
|
|
|
18
|
|
|
|
|
520
|
|
4
|
18
|
|
|
18
|
|
91
|
use warnings; |
|
18
|
|
|
|
|
37
|
|
|
18
|
|
|
|
|
886
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = 'v0.23.1'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Test::OpenTracing::Interface::Base; |
10
|
|
|
|
|
|
|
|
11
|
18
|
|
|
18
|
|
10028
|
use Moo; |
|
18
|
|
|
|
|
207529
|
|
|
18
|
|
|
|
|
83
|
|
12
|
|
|
|
|
|
|
|
13
|
18
|
|
|
18
|
|
26837
|
use Scalar::Util qw/blessed/; |
|
18
|
|
|
|
|
43
|
|
|
18
|
|
|
|
|
922
|
|
14
|
18
|
|
|
18
|
|
11144
|
use Types::Standard qw/ClassName Object Str/; |
|
18
|
|
|
|
|
2164500
|
|
|
18
|
|
|
|
|
254
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has interface_name => ( |
19
|
|
|
|
|
|
|
is => 'ro', |
20
|
|
|
|
|
|
|
isa => Str, |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has test_this => ( |
24
|
|
|
|
|
|
|
is => 'ro', |
25
|
|
|
|
|
|
|
isa => ClassName | Object, |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
has message => ( |
29
|
|
|
|
|
|
|
is => 'ro', |
30
|
|
|
|
|
|
|
isa => Str, |
31
|
|
|
|
|
|
|
predicate => 1, |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub this_name { |
35
|
66
|
|
|
66
|
0
|
161
|
my $self = shift; |
36
|
|
|
|
|
|
|
|
37
|
66
|
100
|
|
|
|
297
|
my $this_name = defined blessed( $self->test_this ) ? |
38
|
|
|
|
|
|
|
blessed( $self->test_this ) : $self->test_this; |
39
|
|
|
|
|
|
|
|
40
|
66
|
|
|
|
|
149
|
return $this_name |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
package Test::OpenTracing::Interface::CanAll; |
46
|
|
|
|
|
|
|
|
47
|
18
|
|
|
18
|
|
52801
|
use strict; |
|
18
|
|
|
|
|
47
|
|
|
18
|
|
|
|
|
447
|
|
48
|
18
|
|
|
18
|
|
106
|
use warnings; |
|
18
|
|
|
|
|
48
|
|
|
18
|
|
|
|
|
614
|
|
49
|
|
|
|
|
|
|
|
50
|
18
|
|
|
18
|
|
101
|
use Moo; |
|
18
|
|
|
|
|
389
|
|
|
18
|
|
|
|
|
171
|
|
51
|
|
|
|
|
|
|
extends 'Test::OpenTracing::Interface::Base'; |
52
|
|
|
|
|
|
|
|
53
|
18
|
|
|
18
|
|
7053
|
use Test::Builder; |
|
18
|
|
|
|
|
47
|
|
|
18
|
|
|
|
|
516
|
|
54
|
18
|
|
|
18
|
|
122
|
use Types::Standard qw/ArrayRef Str/; |
|
18
|
|
|
|
|
45
|
|
|
18
|
|
|
|
|
83
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
has interface_methods => ( |
59
|
|
|
|
|
|
|
is => 'ro', |
60
|
|
|
|
|
|
|
isa => ArrayRef[ Str ] |
61
|
|
|
|
|
|
|
); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub run_tests{ |
66
|
18
|
|
|
18
|
0
|
43
|
my $self = shift; |
67
|
|
|
|
|
|
|
|
68
|
18
|
|
|
|
|
71
|
my $test_name = $self->this_name; |
69
|
|
|
|
|
|
|
|
70
|
18
|
|
|
|
|
89
|
my $Test = Test::Builder->new; |
71
|
18
|
|
|
|
|
132
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
72
|
|
|
|
|
|
|
|
73
|
18
|
|
|
18
|
|
30107
|
no strict qw/refs/; |
|
18
|
|
|
|
|
63
|
|
|
18
|
|
|
|
|
4987
|
|
74
|
18
|
|
|
|
|
34
|
my @failures; |
75
|
18
|
|
|
|
|
30
|
foreach my $test_method ( sort @{$self->interface_methods} ) { |
|
18
|
|
|
|
|
136
|
|
76
|
90
|
100
|
|
|
|
545
|
next if $self->test_this->can($test_method); |
77
|
30
|
|
|
|
|
98
|
$Test->diag( $self->diag_message($test_method) ); |
78
|
30
|
|
|
|
|
7696
|
push @failures, $test_method; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
18
|
100
|
|
|
|
57
|
my $ok = scalar @failures ? 0 : 1; |
82
|
18
|
|
|
|
|
60
|
return $Test->ok( $ok, $self->test_message ); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub diag_message { |
89
|
30
|
|
|
30
|
0
|
56
|
my $self = shift; |
90
|
30
|
|
|
|
|
49
|
my $method_name = shift; |
91
|
|
|
|
|
|
|
|
92
|
30
|
|
|
|
|
112
|
my $this_name = $self->this_name(); |
93
|
|
|
|
|
|
|
|
94
|
30
|
|
|
|
|
146
|
return "$this_name->can('$method_name') failed" |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub test_message { |
100
|
18
|
|
|
18
|
0
|
35
|
my $self = shift; |
101
|
|
|
|
|
|
|
|
102
|
18
|
50
|
|
|
|
75
|
return $self->message if $self->has_message; |
103
|
|
|
|
|
|
|
|
104
|
18
|
|
|
|
|
41
|
my $this_name = $self->this_name(); |
105
|
18
|
|
|
|
|
58
|
my $interface_name = $self->interface_name; |
106
|
|
|
|
|
|
|
|
107
|
18
|
|
|
|
|
96
|
return "$this_name->can_all_ok( '$interface_name' )" |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
1; |