line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::OpenTracing::Interface::Tracer; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Test::OpenTracing::Interface::Tracer - compliance testing |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use Test::OpenTracing::Interface::ContextReference qw/:all/; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
can_all_ok 'MyImplementation::ContextReference', |
12
|
|
|
|
|
|
|
"MyImplementation class does have all subs defined, well done!"; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# lets be a bit fancy, a proper Implementation should have a C |
15
|
|
|
|
|
|
|
# method to setup a Tracer, lets see if that works too: |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
use MyImplementation; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my $test_thing = MyImplementation |
20
|
|
|
|
|
|
|
->bootstrap( @implementation_args ); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
can_all_ok( $test_thing, |
23
|
|
|
|
|
|
|
"An object returned by 'bootstrap' has all required subs defined" |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
3
|
|
|
3
|
|
374479
|
use strict; |
|
3
|
|
|
|
|
35
|
|
|
3
|
|
|
|
|
94
|
|
29
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
137
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
our $VERSION = '0.03_001'; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
3
|
|
|
3
|
|
1306
|
use Test::OpenTracing::Interface; |
|
3
|
|
|
|
|
13
|
|
|
3
|
|
|
|
|
144
|
|
35
|
|
|
|
|
|
|
|
36
|
3
|
|
|
3
|
|
27
|
use Exporter qw/import/; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
191
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
our @EXPORT_OK = qw/can_all_ok/; |
39
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( all => [qw/can_all_ok/] ); |
40
|
|
|
|
|
|
|
|
41
|
3
|
|
|
3
|
|
1370
|
use syntax qw/maybe/; |
|
3
|
|
|
|
|
62736
|
|
|
3
|
|
|
|
|
15
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 DESCRIPTION |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
This package will provide the tests as described in |
48
|
|
|
|
|
|
|
L. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 EXPORTED SUBROUTINES |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 C |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Test that all methods mentioned in L |
61
|
|
|
|
|
|
|
are defined. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub can_all_ok { |
66
|
3
|
|
|
3
|
1
|
9685
|
my $thing = shift; |
67
|
3
|
|
|
|
|
8
|
my $message = shift; |
68
|
|
|
|
|
|
|
|
69
|
3
|
|
|
|
|
99
|
my $Test = Test::OpenTracing::Interface::CanAll->new( |
70
|
|
|
|
|
|
|
test_this => $thing, |
71
|
|
|
|
|
|
|
interface_name => 'Tracer', |
72
|
|
|
|
|
|
|
interface_methods => [ |
73
|
|
|
|
|
|
|
'extract_context', |
74
|
|
|
|
|
|
|
'get_active_span', |
75
|
|
|
|
|
|
|
'get_scope_manager', |
76
|
|
|
|
|
|
|
'inject_context', |
77
|
|
|
|
|
|
|
'start_active_span', |
78
|
|
|
|
|
|
|
'start_span', |
79
|
|
|
|
|
|
|
], |
80
|
|
|
|
|
|
|
maybe |
81
|
|
|
|
|
|
|
message => $message, |
82
|
|
|
|
|
|
|
); |
83
|
|
|
|
|
|
|
|
84
|
3
|
|
|
|
|
3352
|
return $Test->run_tests; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 SEE ALSO |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=over |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=item L |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Test OpenTracing::Interface compliance. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=item L |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Defines the ContextReference. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=back |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 AUTHOR |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Theo van Hoesel |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
'Test OpenTracing' is Copyright (C) 2020, Perceptyx Inc |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it under |
116
|
|
|
|
|
|
|
the terms of the Artistic License 2.0. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful, but it is |
119
|
|
|
|
|
|
|
provided "as is" and without any express or implied warranties. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
For details, see the full text of the license in the file LICENSE. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=cut |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
1; |