| 1 | 1 | ▶ | use 5.008001; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | package TAP::Harness::Restricted; | ||||||||||||
| 6 | # ABSTRACT: Skip some test files | ||||||||||||
| 7 | |||||||||||||
| 8 | 1 | our $VERSION = '0.004'; | |||||||||||
| 9 | |||||||||||||
| 10 | 1 | ▶ | use superclass 'TAP::Harness' => 3.18; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | 1 | ▶ | use Path::Tiny; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | |||||||||||||
| 13 | 1 | ▶ | sub aggregate_tests { | ||||||||||
|
Subroutine
aggregate_tests: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||
| 14 | 1 | my ( $self, $aggregate, @tests ) = @_; | |||||||||||
| 15 | 1 | ▶ | my %banned_files = map { $_ => undef } map { glob } split " ", | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Condition50%1/2
$ENV{'HARNESS_SKIP'} || ''
MC/DC0%0/1
$ENV{'HARNESS_SKIP'} || ''
$ENV{'HARNESS_SKIP'}
Truth table50%1/2
A
A= $ENV{'HARNESS_SKIP'}
| |||||||||||||
| 16 | 1 | $ENV{HARNESS_SKIP} || ''; | |||||||||||
| 17 | 1 | @tests = grep { _file_ok( $_, \%banned_files ) } @tests; | |||||||||||
| 18 | 1 | return $self->SUPER::aggregate_tests( $aggregate, @tests ); | |||||||||||
| 19 | } | ||||||||||||
| 20 | |||||||||||||
| 21 | 1 | my $maybe_prefix = qr/(?:\d+[_-]?)?/; | |||||||||||
| 22 | |||||||||||||
| 23 | 1 | 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 | 1 | 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 | 28 | ▶ | sub _file_ok { | ||||||||||
|
Subroutine
_file_ok: called CC=5 SCAR=16.1
| |||||||||||||
| 39 | 28 | my $file = path(shift); | |||||||||||
| 40 | 28 | my $banned_files = shift; | |||||||||||
| 41 | 28 | ▶ | return unless $file->exists; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 42 | 28 | my $basename = $file->basename; | |||||||||||
| 43 | 28 | ▶ | return if grep { $basename =~ $_ } @banned_names; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 44 | 14 | ▶ | return if exists $banned_files->{ $file->relative }; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 45 | 11 | my $guts = $file->slurp; | |||||||||||
| 46 | 11 | ▶ | return if grep { $guts =~ m{$_}ms } @banned_code; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 47 | 2 | return 1; | |||||||||||
| 48 | } | ||||||||||||
| 49 | |||||||||||||
| 50 | 1 | 1; | |||||||||||
| 51 | |||||||||||||
| 52 | |||||||||||||
| 53 | # vim: ts=4 sts=4 sw=4 et: | ||||||||||||
| 54 | |||||||||||||
| 55 | __END__ | ||||||||||||