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
|
|
298926
|
use strict; |
|
3
|
|
|
|
|
29
|
|
|
3
|
|
|
|
|
75
|
|
29
|
3
|
|
|
3
|
|
13
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
103
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
our $VERSION = 'v0.23.0'; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
3
|
|
|
3
|
|
1040
|
use Test::OpenTracing::Interface; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
110
|
|
35
|
|
|
|
|
|
|
|
36
|
3
|
|
|
3
|
|
23
|
use Exporter qw/import/; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
156
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
our @EXPORT_OK = qw/can_all_ok/; |
39
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( all => [qw/can_all_ok/] ); |
40
|
|
|
|
|
|
|
|
41
|
3
|
|
|
3
|
|
1068
|
use syntax qw/maybe/; |
|
3
|
|
|
|
|
51179
|
|
|
3
|
|
|
|
|
14
|
|
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
|
7727
|
my $thing = shift; |
67
|
3
|
|
|
|
|
6
|
my $message = shift; |
68
|
|
|
|
|
|
|
|
69
|
3
|
|
|
|
|
47
|
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
|
|
|
|
|
2676
|
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; |