line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#line 1 |
2
|
|
|
|
|
|
|
package Test::UseAllModules;
|
3
|
1
|
|
|
1
|
|
1045
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
5
|
1
|
|
|
1
|
|
1026
|
use warnings;
|
|
1
|
|
|
|
|
10934
|
|
|
1
|
|
|
|
|
91
|
|
6
|
|
|
|
|
|
|
use ExtUtils::Manifest qw( maniread );
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.13';
|
9
|
1
|
|
|
1
|
|
9
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
53
|
|
10
|
|
|
|
|
|
|
use Exporter;
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @ISA = qw/Exporter/;
|
13
|
|
|
|
|
|
|
our @EXPORT = qw/all_uses_ok/;
|
14
|
1
|
|
|
1
|
|
1139
|
|
|
1
|
|
|
|
|
18685
|
|
|
1
|
|
|
|
|
7
|
|
15
|
|
|
|
|
|
|
use Test::More;
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $RULE = qr{^lib/(.+)\.pm$};
|
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
61
|
sub import {
|
20
|
|
|
|
|
|
|
shift->export_to_level(1);
|
21
|
1
|
50
|
33
|
|
|
5
|
|
22
|
1
|
|
|
|
|
2
|
shift if @_ && $_[0] eq 'under';
|
23
|
1
|
|
|
|
|
1
|
my @dirs = ('lib', @_);
|
24
|
1
|
|
|
|
|
2
|
my %seen;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
25
|
1
|
|
|
|
|
4
|
@dirs = grep { !$seen{$_}++ } map { s|/+$||; $_ } @dirs;
|
26
|
1
|
|
|
|
|
24
|
$RULE = '^(?:'.(join '|', @dirs).')/(.+)\.pm\s*$';
|
27
|
|
|
|
|
|
|
unshift @INC, @dirs;
|
28
|
|
|
|
|
|
|
}
|
29
|
|
|
|
|
|
|
|
30
|
1
|
50
|
33
|
1
|
|
6
|
sub _get_module_list {
|
31
|
1
|
|
|
|
|
1
|
shift if @_ && $_[0] eq 'except';
|
32
|
1
|
|
|
|
|
2
|
my @exceptions = @_;
|
33
|
|
|
|
|
|
|
my @modules;
|
34
|
1
|
|
|
|
|
4
|
|
35
|
|
|
|
|
|
|
my $manifest = maniread();
|
36
|
1
|
|
|
|
|
14
|
|
37
|
1
|
|
|
|
|
1658
|
READ:
|
38
|
104
|
100
|
|
|
|
254
|
foreach my $file (keys %{ $manifest }) {
|
39
|
11
|
|
|
|
|
43
|
if (my ($module) = $file =~ m|$RULE|) {
|
40
|
|
|
|
|
|
|
$module =~ s|/|::|g;
|
41
|
11
|
|
|
|
|
15
|
|
42
|
0
|
0
|
0
|
|
|
0
|
foreach my $rule (@exceptions) {
|
43
|
|
|
|
|
|
|
next READ if $module eq $rule || $module =~ /$rule/;
|
44
|
|
|
|
|
|
|
}
|
45
|
11
|
|
|
|
|
17
|
|
46
|
|
|
|
|
|
|
push @modules, $module;
|
47
|
|
|
|
|
|
|
}
|
48
|
1
|
|
|
|
|
27
|
}
|
49
|
|
|
|
|
|
|
return @modules;
|
50
|
|
|
|
|
|
|
}
|
51
|
|
|
|
|
|
|
|
52
|
1
|
50
|
|
1
|
|
6
|
sub _planned {
|
53
|
0
|
|
|
|
|
0
|
if ($Test::More::VERSION >= 2) {
|
54
|
|
|
|
|
|
|
Test::More->builder->_plan_handled;
|
55
|
1
|
|
|
|
|
9
|
} else {
|
56
|
|
|
|
|
|
|
Test::More->builder->{Have_Plan};
|
57
|
|
|
|
|
|
|
}
|
58
|
|
|
|
|
|
|
}
|
59
|
|
|
|
|
|
|
|
60
|
1
|
50
|
|
1
|
1
|
21
|
sub all_uses_ok {
|
61
|
0
|
0
|
|
|
|
0
|
unless (-f 'MANIFEST') {
|
62
|
0
|
|
|
|
|
0
|
plan skip_all => 'no MANIFEST' unless _planned();
|
63
|
|
|
|
|
|
|
return;
|
64
|
|
|
|
|
|
|
}
|
65
|
1
|
|
|
|
|
2
|
|
66
|
|
|
|
|
|
|
my @modules = _get_module_list(@_);
|
67
|
1
|
50
|
|
|
|
4
|
|
68
|
0
|
0
|
|
|
|
0
|
unless (@modules) {
|
69
|
0
|
|
|
|
|
0
|
plan skip_all => 'no .pm files are found under the lib directory' unless _planned();
|
70
|
|
|
|
|
|
|
return;
|
71
|
1
|
50
|
|
|
|
3
|
}
|
72
|
|
|
|
|
|
|
plan tests => scalar @modules unless _planned();
|
73
|
1
|
|
|
|
|
172
|
|
74
|
1
|
|
|
|
|
2
|
my @failed;
|
75
|
1
|
50
|
|
1
|
|
1168
|
foreach my $module (@modules) {
|
|
1
|
|
|
1
|
|
55
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
21
|
|
|
1
|
|
|
1
|
|
1046
|
|
|
1
|
|
|
1
|
|
52
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
19
|
|
|
1
|
|
|
1
|
|
1388
|
|
|
1
|
|
|
1
|
|
58
|
|
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
|
|
17
|
|
|
1
|
|
|
|
|
1012
|
|
|
1
|
|
|
|
|
55
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
|
1
|
|
|
|
|
2030
|
|
|
1
|
|
|
|
|
51
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
|
1
|
|
|
|
|
94
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
1513
|
|
|
1
|
|
|
|
|
60
|
|
|
1
|
|
|
|
|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