line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::OpenTracing::Interface; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
18
|
|
125
|
use strict; |
|
18
|
|
|
|
|
40
|
|
|
18
|
|
|
|
|
514
|
|
4
|
18
|
|
|
18
|
|
98
|
use warnings; |
|
18
|
|
|
|
|
40
|
|
|
18
|
|
|
|
|
853
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.03_001'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Test::OpenTracing::Interface::Base; |
10
|
|
|
|
|
|
|
|
11
|
18
|
|
|
18
|
|
10135
|
use Moo; |
|
18
|
|
|
|
|
213656
|
|
|
18
|
|
|
|
|
101
|
|
12
|
|
|
|
|
|
|
|
13
|
18
|
|
|
18
|
|
27370
|
use Scalar::Util qw/blessed/; |
|
18
|
|
|
|
|
46
|
|
|
18
|
|
|
|
|
1015
|
|
14
|
18
|
|
|
18
|
|
11002
|
use Types::Standard qw/ClassName Object Str/; |
|
18
|
|
|
|
|
1830605
|
|
|
18
|
|
|
|
|
266
|
|
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
|
65
|
|
|
65
|
0
|
113
|
my $self = shift; |
36
|
|
|
|
|
|
|
|
37
|
65
|
100
|
|
|
|
314
|
my $this_name = defined blessed( $self->test_this ) ? |
38
|
|
|
|
|
|
|
blessed( $self->test_this ) : $self->test_this; |
39
|
|
|
|
|
|
|
|
40
|
65
|
|
|
|
|
151
|
return $this_name |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
package Test::OpenTracing::Interface::CanAll; |
46
|
|
|
|
|
|
|
|
47
|
18
|
|
|
18
|
|
23846
|
use strict; |
|
18
|
|
|
|
|
51
|
|
|
18
|
|
|
|
|
476
|
|
48
|
18
|
|
|
18
|
|
115
|
use warnings; |
|
18
|
|
|
|
|
62
|
|
|
18
|
|
|
|
|
618
|
|
49
|
|
|
|
|
|
|
|
50
|
18
|
|
|
18
|
|
117
|
use Moo; |
|
18
|
|
|
|
|
43
|
|
|
18
|
|
|
|
|
184
|
|
51
|
|
|
|
|
|
|
extends 'Test::OpenTracing::Interface::Base'; |
52
|
|
|
|
|
|
|
|
53
|
18
|
|
|
18
|
|
7233
|
use Test::Builder; |
|
18
|
|
|
|
|
49
|
|
|
18
|
|
|
|
|
520
|
|
54
|
18
|
|
|
18
|
|
109
|
use Types::Standard qw/ArrayRef Str/; |
|
18
|
|
|
|
|
43
|
|
|
18
|
|
|
|
|
79
|
|
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
|
53
|
my $self = shift; |
67
|
|
|
|
|
|
|
|
68
|
18
|
|
|
|
|
83
|
my $test_name = $self->this_name; |
69
|
|
|
|
|
|
|
|
70
|
18
|
|
|
|
|
93
|
my $Test = Test::Builder->new; |
71
|
18
|
|
|
|
|
136
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
72
|
|
|
|
|
|
|
|
73
|
18
|
|
|
18
|
|
12453
|
no strict qw/refs/; |
|
18
|
|
|
|
|
52
|
|
|
18
|
|
|
|
|
4244
|
|
74
|
18
|
|
|
|
|
37
|
my @failures; |
75
|
18
|
|
|
|
|
31
|
foreach my $test_method ( sort @{$self->interface_methods} ) { |
|
18
|
|
|
|
|
110
|
|
76
|
87
|
100
|
|
|
|
543
|
next if $self->test_this->can($test_method); |
77
|
29
|
|
|
|
|
103
|
$Test->diag( $self->diag_message($test_method) ); |
78
|
29
|
|
|
|
|
7802
|
push @failures, $test_method; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
18
|
100
|
|
|
|
58
|
my $ok = scalar @failures ? 0 : 1; |
82
|
18
|
|
|
|
|
57
|
return $Test->ok( $ok, $self->test_message ); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub diag_message { |
89
|
29
|
|
|
29
|
0
|
52
|
my $self = shift; |
90
|
29
|
|
|
|
|
53
|
my $method_name = shift; |
91
|
|
|
|
|
|
|
|
92
|
29
|
|
|
|
|
107
|
my $this_name = $self->this_name(); |
93
|
|
|
|
|
|
|
|
94
|
29
|
|
|
|
|
151
|
return "$this_name->can('$method_name') failed" |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub test_message { |
100
|
18
|
|
|
18
|
0
|
36
|
my $self = shift; |
101
|
|
|
|
|
|
|
|
102
|
18
|
50
|
|
|
|
77
|
return $self->message if $self->has_message; |
103
|
|
|
|
|
|
|
|
104
|
18
|
|
|
|
|
45
|
my $this_name = $self->this_name(); |
105
|
18
|
|
|
|
|
56
|
my $interface_name = $self->interface_name; |
106
|
|
|
|
|
|
|
|
107
|
18
|
|
|
|
|
128
|
return "$this_name->can_all_ok( '$interface_name' )" |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
1; |