Interface/Span.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 100% 30 / 30 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Interface/ScopeManager.pm ↑ Summary Interface/SpanContext.pm »
1 package Test::OpenTracing::Interface::Span;
2  
3 =head1 NAME
4  
5 Test::OpenTracing::Interface::Span - compliance testing
6  
7 =head1 SYNOPSIS
8  
9 use Test::OpenTracing::Interface::Span qw/:all/;
10
11 can_all_ok 'MyImplementation::Span',
12 "MyImplementation class does have all subs defined, well done!";
13
14 my $test_thing = MyImplementation::Span->new ( ... );
15
16 can_all_ok( $test_thing,
17 "An object constructed by 'new' has all required subs defined"
18 );
19  
20 =cut
21  
22 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 3 our $VERSION = 'v0.23.1';
26  
27  
28 3 ▶use Test::OpenTracing::Interface;
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30 3 ▶use Exporter qw/import/;
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 3 our @EXPORT_OK = qw/can_all_ok/;
33 3 our %EXPORT_TAGS = ( all => [qw/can_all_ok/] );
34  
35 3 ▶use syntax qw/maybe/;
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37  
38  
39 =head1 DESCRIPTION
40  
41 This package will provide the tests as described in
42 L<Test::OpenTracing::Interface>.
43  
44  
45  
46 =head1 EXPORTED SUBROUTINES
47  
48 =cut
49  
50  
51  
52 =head2 C<can_all_ok>
53  
54 Test that all methods mentioned in L<OpenTracing::Interface::Span>
55 are defined.
56  
57 =cut
58  
59 3 ▶sub can_all_ok {
Subroutine can_all_ok: called CC=1 SCAR=0.0
Pod documented
60 3 my $thing = shift;
61 3 my $message = shift;
62
63 3 my $Test = Test::OpenTracing::Interface::CanAll->new(
64 test_this => $thing,
65 interface_name => 'Span',
66 interface_methods => [
67 'add_baggage_item',
68 'add_baggage_items',
69 'add_tag',
70 'add_tags',
71 'finish',
72 'get_baggage_item',
73 'get_baggage_items',
74 'get_context',
75 'get_tags',
76 'log_data',
77 'overwrite_operation_name',
78 ],
79 maybe
80 message => $message,
81 );
82
83 3 return $Test->run_tests;
84 }
85  
86  
87  
88 =head1 SEE ALSO
89  
90 =over
91  
92 =item L<Test::OpenTracing::Interface>
93  
94 Test OpenTracing::Interface compliance.
95  
96 =item L<OpenTracing::Interface::Span>
97  
98 Defines the ContextReference.
99  
100 =back
101  
102  
103  
104 =head1 AUTHOR
105  
106 Theo van Hoesel <tvanhoesel@perceptyx.com>
107  
108  
109  
110 =head1 COPYRIGHT AND LICENSE
111  
112 'Test OpenTracing' is Copyright (C) 2020, Perceptyx Inc
113  
114 This library is free software; you can redistribute it and/or modify it under
115 the terms of the Artistic License 2.0.
116  
117 This library is distributed in the hope that it will be useful, but it is
118 provided "as is" and without any express or implied warranties.
119  
120 For details, see the full text of the license in the file LICENSE.
121  
122  
123  
124 =cut
125  
126 3 1;
« Interface/ScopeManager.pm ↑ Summary Interface/SpanContext.pm »