| 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 | 1 | our $VERSION = '0.003'; # VERSION | |||||||||||
| 8 | |||||||||||||
| 9 | 1 | ▶ | use superclass 'TAP::Harness' => 3.18; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | 1 | ▶ | use Path::Tiny; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | |||||||||||||
| 12 | sub aggregate_tests { | ||||||||||||
| 13 | 1 | ▶ | my ( $self, $aggregate, @tests ) = @_; | ||||||||||
|
Subroutine
aggregate_tests: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||
| 14 | 3 | ▶ | my %banned_files = map { $_ => undef } map { glob } split " ", | ||||||||||
|
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'}
| |||||||||||||
| 15 | 1 | $ENV{HARNESS_SKIP} || ''; | |||||||||||
| 16 | 1 | @tests = grep { _file_ok( $_, \%banned_files ) } @tests; | |||||||||||
| 17 | 1 | return $self->SUPER::aggregate_tests( $aggregate, @tests ); | |||||||||||
| 18 | } | ||||||||||||
| 19 | |||||||||||||
| 20 | 1 | my $maybe_prefix = qr/(?:\d+[_-]?)?/; | |||||||||||
| 21 | |||||||||||||
| 22 | 1 | my @banned_names = | |||||||||||
| 23 | ( qr/${maybe_prefix}pod\.t/, qr/${maybe_prefix}pod[_-]?coverage\.t/, ); | ||||||||||||
| 24 | |||||||||||||
| 25 | 1 | my @banned_code = ( | |||||||||||
| 26 | qr/use Test::Pod/, # also gets Test::Pod::Coverage | ||||||||||||
| 27 | ); | ||||||||||||
| 28 | |||||||||||||
| 29 | sub _file_ok { | ||||||||||||
| 30 | 13 | ▶ | my $file = path(shift); | ||||||||||
|
Subroutine
_file_ok: called CC=5 SCAR=16.1
| |||||||||||||
| 31 | 13 | my $banned_files = shift; | |||||||||||
| 32 | 13 | ▶ | return unless $file->exists; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 33 | 13 | my $basename = $file->basename; | |||||||||||
| 34 | 13 | ▶ | return if grep { $basename =~ $_ } @banned_names; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 35 | 7 | ▶ | return if exists $banned_files->{ $file->relative }; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 36 | 4 | my $guts = $file->slurp; | |||||||||||
| 37 | 4 | ▶ | return if grep { $guts =~ m{$_}ms } @banned_code; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 38 | 2 | return 1; | |||||||||||
| 39 | } | ||||||||||||
| 40 | |||||||||||||
| 41 | 1 | 1; | |||||||||||
| 42 | |||||||||||||
| 43 | |||||||||||||
| 44 | # vim: ts=4 sts=4 sw=4 et: | ||||||||||||
| 45 | |||||||||||||
| 46 | __END__ | ||||||||||||