line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::OpenTracing::Interface::ContextReference; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Test::OpenTracing::Interface::ContextReference - 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
|
|
|
|
|
|
|
my $mocked_span_context = bless {}, 'MyImplementation::SpanContext'; |
15
|
|
|
|
|
|
|
# |
16
|
|
|
|
|
|
|
# calling `new` reuires other dependencies |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $test_thing = MyImplementation::ContextReference |
19
|
|
|
|
|
|
|
->new_child_of( $mocked_span_context ); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
can_all_ok( $test_thing, |
22
|
|
|
|
|
|
|
"An object returned by 'new_child_of' has all required subs defined" |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
|
27
|
3
|
|
|
3
|
|
375598
|
use strict; |
|
3
|
|
|
|
|
29
|
|
|
3
|
|
|
|
|
124
|
|
28
|
3
|
|
|
3
|
|
23
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
142
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
our $VERSION = 'v0.23.0'; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
3
|
|
|
3
|
|
1286
|
use Test::OpenTracing::Interface; |
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
143
|
|
34
|
|
|
|
|
|
|
|
35
|
3
|
|
|
3
|
|
30
|
use Exporter qw/import/; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
202
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
our @EXPORT_OK = qw/can_all_ok/; |
38
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( all => [qw/can_all_ok/] ); |
39
|
|
|
|
|
|
|
|
40
|
3
|
|
|
3
|
|
1404
|
use syntax qw/maybe/; |
|
3
|
|
|
|
|
61291
|
|
|
3
|
|
|
|
|
14
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 DESCRIPTION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
This package will provide the tests as described in |
47
|
|
|
|
|
|
|
L. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 EXPORTED SUBROUTINES |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 C |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Test that all methods mentioned in L |
60
|
|
|
|
|
|
|
are defined. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub can_all_ok { |
65
|
3
|
|
|
3
|
1
|
8947
|
my $thing = shift; |
66
|
3
|
|
|
|
|
8
|
my $message = shift; |
67
|
|
|
|
|
|
|
|
68
|
3
|
|
|
|
|
53
|
my $Test = Test::OpenTracing::Interface::CanAll->new( |
69
|
|
|
|
|
|
|
test_this => $thing, |
70
|
|
|
|
|
|
|
interface_name => 'ContextReference', |
71
|
|
|
|
|
|
|
interface_methods => [ |
72
|
|
|
|
|
|
|
'new_child_of', |
73
|
|
|
|
|
|
|
'new_follows_from', |
74
|
|
|
|
|
|
|
'get_referenced_context', |
75
|
|
|
|
|
|
|
'type_is_child_of', |
76
|
|
|
|
|
|
|
'type_is_follows_from', |
77
|
|
|
|
|
|
|
], |
78
|
|
|
|
|
|
|
maybe |
79
|
|
|
|
|
|
|
message => $message, |
80
|
|
|
|
|
|
|
); |
81
|
|
|
|
|
|
|
|
82
|
3
|
|
|
|
|
3265
|
return $Test->run_tests; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 SEE ALSO |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=over |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=item L |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Test OpenTracing::Interface compliance. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item L |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Defines the ContextReference. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=back |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 AUTHOR |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Theo van Hoesel |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
'Test OpenTracing' is Copyright (C) 2020, Perceptyx Inc |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it under |
114
|
|
|
|
|
|
|
the terms of the Artistic License 2.0. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful, but it is |
117
|
|
|
|
|
|
|
provided "as is" and without any express or implied warranties. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
For details, see the full text of the license in the file LICENSE. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=cut |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
1; |