line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::OpenTracing::Interface; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
18
|
|
110
|
use strict; |
|
18
|
|
|
|
|
36
|
|
|
18
|
|
|
|
|
495
|
|
4
|
18
|
|
|
18
|
|
85
|
use warnings; |
|
18
|
|
|
|
|
32
|
|
|
18
|
|
|
|
|
765
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = 'v0.23.0'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Test::OpenTracing::Interface::Base; |
10
|
|
|
|
|
|
|
|
11
|
18
|
|
|
18
|
|
9334
|
use Moo; |
|
18
|
|
|
|
|
189632
|
|
|
18
|
|
|
|
|
126
|
|
12
|
|
|
|
|
|
|
|
13
|
18
|
|
|
18
|
|
24229
|
use Scalar::Util qw/blessed/; |
|
18
|
|
|
|
|
38
|
|
|
18
|
|
|
|
|
894
|
|
14
|
18
|
|
|
18
|
|
9436
|
use Types::Standard qw/ClassName Object Str/; |
|
18
|
|
|
|
|
1644293
|
|
|
18
|
|
|
|
|
252
|
|
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
|
93
|
my $self = shift; |
36
|
|
|
|
|
|
|
|
37
|
66
|
100
|
|
|
|
270
|
my $this_name = defined blessed( $self->test_this ) ? |
38
|
|
|
|
|
|
|
blessed( $self->test_this ) : $self->test_this; |
39
|
|
|
|
|
|
|
|
40
|
66
|
|
|
|
|
125
|
return $this_name |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
package Test::OpenTracing::Interface::CanAll; |
46
|
|
|
|
|
|
|
|
47
|
18
|
|
|
18
|
|
34605
|
use strict; |
|
18
|
|
|
|
|
41
|
|
|
18
|
|
|
|
|
449
|
|
48
|
18
|
|
|
18
|
|
93
|
use warnings; |
|
18
|
|
|
|
|
47
|
|
|
18
|
|
|
|
|
572
|
|
49
|
|
|
|
|
|
|
|
50
|
18
|
|
|
18
|
|
93
|
use Moo; |
|
18
|
|
|
|
|
39
|
|
|
18
|
|
|
|
|
147
|
|
51
|
|
|
|
|
|
|
extends 'Test::OpenTracing::Interface::Base'; |
52
|
|
|
|
|
|
|
|
53
|
18
|
|
|
18
|
|
6384
|
use Test::Builder; |
|
18
|
|
|
|
|
46
|
|
|
18
|
|
|
|
|
455
|
|
54
|
18
|
|
|
18
|
|
83
|
use Types::Standard qw/ArrayRef Str/; |
|
18
|
|
|
|
|
37
|
|
|
18
|
|
|
|
|
73
|
|
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
|
40
|
my $self = shift; |
67
|
|
|
|
|
|
|
|
68
|
18
|
|
|
|
|
72
|
my $test_name = $self->this_name; |
69
|
|
|
|
|
|
|
|
70
|
18
|
|
|
|
|
87
|
my $Test = Test::Builder->new; |
71
|
18
|
|
|
|
|
128
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
72
|
|
|
|
|
|
|
|
73
|
18
|
|
|
18
|
|
11323
|
no strict qw/refs/; |
|
18
|
|
|
|
|
40
|
|
|
18
|
|
|
|
|
3953
|
|
74
|
18
|
|
|
|
|
33
|
my @failures; |
75
|
18
|
|
|
|
|
29
|
foreach my $test_method ( sort @{$self->interface_methods} ) { |
|
18
|
|
|
|
|
94
|
|
76
|
90
|
100
|
|
|
|
474
|
next if $self->test_this->can($test_method); |
77
|
30
|
|
|
|
|
83
|
$Test->diag( $self->diag_message($test_method) ); |
78
|
30
|
|
|
|
|
6845
|
push @failures, $test_method; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
18
|
100
|
|
|
|
53
|
my $ok = scalar @failures ? 0 : 1; |
82
|
18
|
|
|
|
|
51
|
return $Test->ok( $ok, $self->test_message ); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub diag_message { |
89
|
30
|
|
|
30
|
0
|
45
|
my $self = shift; |
90
|
30
|
|
|
|
|
47
|
my $method_name = shift; |
91
|
|
|
|
|
|
|
|
92
|
30
|
|
|
|
|
93
|
my $this_name = $self->this_name(); |
93
|
|
|
|
|
|
|
|
94
|
30
|
|
|
|
|
124
|
return "$this_name->can('$method_name') failed" |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub test_message { |
100
|
18
|
|
|
18
|
0
|
33
|
my $self = shift; |
101
|
|
|
|
|
|
|
|
102
|
18
|
50
|
|
|
|
72
|
return $self->message if $self->has_message; |
103
|
|
|
|
|
|
|
|
104
|
18
|
|
|
|
|
39
|
my $this_name = $self->this_name(); |
105
|
18
|
|
|
|
|
62
|
my $interface_name = $self->interface_name; |
106
|
|
|
|
|
|
|
|
107
|
18
|
|
|
|
|
87
|
return "$this_name->can_all_ok( '$interface_name' )" |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
1; |