line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
126611
|
use 5.008001; |
|
1
|
|
|
|
|
17
|
|
2
|
1
|
|
|
1
|
|
9
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
3
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
66
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package TAP::Harness::Restricted; |
6
|
|
|
|
|
|
|
# ABSTRACT: Skip some test files |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.004'; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
538
|
use superclass 'TAP::Harness' => 3.18; |
|
1
|
|
|
|
|
5406
|
|
|
1
|
|
|
|
|
7
|
|
11
|
1
|
|
|
1
|
|
182
|
use Path::Tiny; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
524
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub aggregate_tests { |
14
|
1
|
|
|
1
|
1
|
11874
|
my ( $self, $aggregate, @tests ) = @_; |
15
|
3
|
|
|
|
|
9
|
my %banned_files = map { $_ => undef } map { glob } split " ", |
|
1
|
|
|
|
|
102
|
|
16
|
1
|
|
50
|
|
|
6
|
$ENV{HARNESS_SKIP} || ''; |
17
|
1
|
|
|
|
|
3
|
@tests = grep { _file_ok( $_, \%banned_files ) } @tests; |
|
28
|
|
|
|
|
857
|
|
18
|
1
|
|
|
|
|
17
|
return $self->SUPER::aggregate_tests( $aggregate, @tests ); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $maybe_prefix = qr/(?:\d+[_-]?)?/; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my @banned_names = ( |
24
|
|
|
|
|
|
|
qr/${maybe_prefix}pod\.t/, |
25
|
|
|
|
|
|
|
qr/${maybe_prefix}pod[_-]?coverage\.t/, |
26
|
|
|
|
|
|
|
qr/${maybe_prefix}pod[_-]?spell(?:ing)?\.t/, |
27
|
|
|
|
|
|
|
qr/${maybe_prefix}perl[_-]?critic\.t/, |
28
|
|
|
|
|
|
|
qr/${maybe_prefix}kwalitee\.t/, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my @banned_code = ( |
32
|
|
|
|
|
|
|
qr/\b (?: use | require )\ Test::(?: |
33
|
|
|
|
|
|
|
CleanNamespaces | DependentModules | EOL | Kwalitee | Mojibake |
34
|
|
|
|
|
|
|
| NoTabs | Perl::Critic | Pod | Portability::Files | Spelling | Vars |
35
|
|
|
|
|
|
|
)\b/x, |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _file_ok { |
39
|
28
|
|
|
28
|
|
59
|
my $file = path(shift); |
40
|
28
|
|
|
|
|
588
|
my $banned_files = shift; |
41
|
28
|
50
|
|
|
|
56
|
return unless $file->exists; |
42
|
28
|
|
|
|
|
432
|
my $basename = $file->basename; |
43
|
28
|
100
|
|
|
|
558
|
return if grep { $basename =~ $_ } @banned_names; |
|
140
|
|
|
|
|
416
|
|
44
|
14
|
100
|
|
|
|
35
|
return if exists $banned_files->{ $file->relative }; |
45
|
11
|
|
|
|
|
2786
|
my $guts = $file->slurp; |
46
|
11
|
100
|
|
|
|
1499
|
return if grep { $guts =~ m{$_}ms } @banned_code; |
|
11
|
|
|
|
|
103
|
|
47
|
2
|
|
|
|
|
13
|
return 1; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# vim: ts=4 sts=4 sw=4 et: |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |