File Coverage

blib/lib/Test/OpenTracing/Integration.pm
Criterion Covered Total %
statement 18 30 60.0
branch 1 8 12.5
condition n/a
subroutine 6 9 66.6
pod 4 4 100.0
total 29 51 56.8


line stmt bran cond sub pod time code
1             package Test::OpenTracing::Integration;
2              
3             our $VERSION = 'v0.104.1';
4              
5 2     2   127608 use strict;
  2         18  
  2         59  
6 2     2   18 use warnings;
  2         6  
  2         64  
7 2     2   481 use parent 'Exporter';
  2         301  
  2         20  
8 2     2   164 use Carp qw/croak/;
  2         5  
  2         102  
9 2     2   979 use OpenTracing::GlobalTracer;
  2         6076  
  2         20  
10              
11             our @EXPORT = qw(
12             global_tracer_cmp_deeply
13             global_tracer_cmp_easy
14             global_tracer_cmp_spans
15             reset_spans
16             );
17              
18             sub global_tracer_cmp_easy {
19 0     0 1 0 my $tracer = OpenTracing::GlobalTracer->get_global_tracer;
20 0 0       0 my $next = $tracer->can('cmp_easy')
21             or croak "Not a test implementation, missing 'cmp_easy'";
22 0         0 unshift @_, $tracer;
23 0         0 goto $next;
24             }
25              
26             sub global_tracer_cmp_deeply {
27 0     0 1 0 my $tracer = OpenTracing::GlobalTracer->get_global_tracer;
28 0 0       0 my $next = $tracer->can('cmp_deeply')
29             or croak "Not a test implementation, missing 'cmp_deeply'";
30 0         0 unshift @_, $tracer;
31 0         0 goto $next;
32             }
33              
34             sub global_tracer_cmp_spans {
35 0     0 1 0 my $tracer = OpenTracing::GlobalTracer->get_global_tracer;
36 0 0       0 my $next = $tracer->can('cmp_spans')
37             or croak "Not a test implementation, missing 'cmp_spans'";
38 0         0 unshift @_, $tracer;
39 0         0 goto $next;
40             }
41              
42             sub reset_spans {
43 3     3 1 10882 my $tracer = OpenTracing::GlobalTracer->get_global_tracer;
44 3 50       52 croak "Not a test implementation, missing 'clear_spans'"
45             if !$tracer->can('clear_spans');
46 3         90 return $tracer->clear_spans();
47             }
48              
49             1;