line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Devel::QuickCover; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
216054
|
use strict; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
58
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
56
|
|
5
|
2
|
|
|
2
|
|
10
|
use Carp 'croak'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
86
|
|
6
|
2
|
|
|
2
|
|
12
|
use XSLoader; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
767
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.900014'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
XSLoader::load( 'Devel::QuickCover', $VERSION ); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my %DEFAULT_CONFIG = ( |
13
|
|
|
|
|
|
|
noatexit => 0, # Don't register an atexit handler to dump and cleanup |
14
|
|
|
|
|
|
|
nostart => 0, # Don't start gathering coverage information on import |
15
|
|
|
|
|
|
|
nodump => 0, # Don't dump the coverage report at the END of the program |
16
|
|
|
|
|
|
|
output_directory => '/tmp', # Write report to that directory |
17
|
|
|
|
|
|
|
metadata => {} , # Additional context information |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
our %CONFIG; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub import { |
22
|
2
|
|
|
2
|
|
16
|
my ($class, @opts) = @_; |
23
|
|
|
|
|
|
|
|
24
|
2
|
50
|
|
|
|
12
|
croak('Invalid argument to import, it takes key-value pairs. FOO => BAR') |
25
|
|
|
|
|
|
|
if 1 == @opts % 2; |
26
|
2
|
|
|
|
|
6
|
my %options = @opts; |
27
|
|
|
|
|
|
|
|
28
|
2
|
|
|
|
|
9
|
%CONFIG = %DEFAULT_CONFIG; |
29
|
2
|
|
|
|
|
7
|
for (keys %options) { |
30
|
3
|
50
|
|
|
|
9
|
if (exists $DEFAULT_CONFIG{$_}) { |
31
|
3
|
|
|
|
|
7
|
$CONFIG{$_} = delete $options{$_}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
2
|
50
|
|
|
|
10
|
if (keys %options > 0) { |
36
|
0
|
|
|
|
|
0
|
croak('Invalid import option(s): ' . join ',', keys %options); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
2
|
100
|
|
|
|
1617
|
if (!$CONFIG{'nostart'}) { |
40
|
1
|
|
|
|
|
26
|
Devel::QuickCover::start(); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub set_output_directory { |
45
|
0
|
|
|
0
|
0
|
|
my ($dir) = @_; |
46
|
0
|
0
|
|
|
|
|
return unless $dir; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
$CONFIG{output_directory} = $dir; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub set_metadata { |
52
|
0
|
|
|
0
|
0
|
|
my ($data) = @_; |
53
|
0
|
0
|
|
|
|
|
return unless $data; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
$CONFIG{metadata} = $data; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
END { |
59
|
2
|
|
|
2
|
|
5370
|
Devel::QuickCover::end($CONFIG{'nodump'}); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |