line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::LocalFunctions::Receptor; |
2
|
|
|
|
|
|
|
|
3
|
48
|
|
|
48
|
|
242
|
use strict; |
|
48
|
|
|
|
|
82
|
|
|
48
|
|
|
|
|
1458
|
|
4
|
48
|
|
|
48
|
|
223
|
use warnings; |
|
48
|
|
|
|
|
342
|
|
|
48
|
|
|
|
|
1554
|
|
5
|
48
|
|
|
48
|
|
55602
|
use ExtUtils::Manifest qw/maniread/; |
|
48
|
|
|
|
|
681624
|
|
|
48
|
|
|
|
|
25733
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub all_local_functions_ok { |
8
|
20
|
|
|
20
|
0
|
66
|
my ( $backend, $args ) = @_; |
9
|
|
|
|
|
|
|
|
10
|
20
|
|
|
|
|
570
|
my $builder = $backend->builder; |
11
|
20
|
|
|
|
|
522
|
my @libs = _list_modules_in_manifest($builder, $args->{ignore_modules}); |
12
|
|
|
|
|
|
|
|
13
|
20
|
|
|
|
|
154
|
$builder->plan( tests => scalar @libs ); |
14
|
|
|
|
|
|
|
|
15
|
20
|
|
|
|
|
11066
|
my $fail = 0; |
16
|
20
|
|
|
|
|
78
|
for my $lib (@libs) { |
17
|
62
|
100
|
|
|
|
41250
|
_test_local_functions( $backend, $builder, $lib, $args ) or $fail++; |
18
|
|
|
|
|
|
|
} |
19
|
4
|
|
|
|
|
4208
|
return $fail == 0; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub local_functions_ok { |
23
|
37
|
|
|
37
|
0
|
222
|
my ( $backend, $lib, $args ) = @_; |
24
|
37
|
|
|
|
|
762
|
return _test_local_functions( $backend, $backend->builder, $lib, $args ); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _test_local_functions { |
28
|
99
|
|
|
99
|
|
990
|
my ( $caller, $builder, $file, $args ) = @_; |
29
|
|
|
|
|
|
|
|
30
|
99
|
|
|
|
|
276
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
31
|
|
|
|
|
|
|
|
32
|
99
|
100
|
|
|
|
357
|
my $pid; $pid = fork or do { |
|
99
|
|
|
|
|
120796
|
|
33
|
30
|
50
|
|
|
|
8770
|
defined $pid ? exit $caller->is_in_use( $builder, $file, $args ) |
34
|
|
|
|
|
|
|
: die "failed forking: $!" |
35
|
|
|
|
|
|
|
}; |
36
|
69
|
|
|
|
|
45846960
|
wait; |
37
|
69
|
|
|
|
|
11731
|
return $builder->ok( $? == 0, $file ); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub _list_modules_in_manifest { |
41
|
20
|
|
|
20
|
|
72
|
my ( $builder, $ignores ) = @_; |
42
|
|
|
|
|
|
|
|
43
|
20
|
50
|
|
|
|
722
|
if ( not -f $ExtUtils::Manifest::MANIFEST ) { |
44
|
0
|
|
|
|
|
0
|
$builder->plan( skip_all => "$ExtUtils::Manifest::MANIFEST doesn't exist" ); |
45
|
|
|
|
|
|
|
} |
46
|
20
|
|
|
|
|
132
|
my $manifest = maniread(); |
47
|
20
|
|
|
|
|
10086
|
my @libs = grep { m!\Alib/.*\.pm\Z! } keys %{$manifest}; |
|
764
|
|
|
|
|
1348
|
|
|
20
|
|
|
|
|
178
|
|
48
|
|
|
|
|
|
|
|
49
|
20
|
|
|
|
|
122
|
for my $ignore (@$ignores) { |
50
|
6
|
|
|
|
|
16
|
$ignore =~ s!::!/!g; |
51
|
6
|
|
|
|
|
16
|
$ignore =~ /\.pm\Z/; |
52
|
6
|
100
|
|
|
|
24
|
$ignore .= '.pm' if $& ne '.pm'; |
53
|
6
|
|
|
|
|
12
|
$ignore =~ m!\Alib/!; |
54
|
6
|
100
|
|
|
|
22
|
$ignore = "lib/$ignore" if $& ne 'lib/'; |
55
|
6
|
|
|
|
|
16
|
@libs = grep { $_ ne $ignore } @libs; |
|
18
|
|
|
|
|
46
|
|
56
|
|
|
|
|
|
|
} |
57
|
20
|
|
|
|
|
236
|
return @libs; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
1; |