line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Harness::FileFilter; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
24521
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
49
|
|
4
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
46
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
970
|
use File::Spec::Functions qw(splitpath); |
|
1
|
|
|
|
|
998
|
|
|
1
|
|
|
|
|
91
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
6
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
110
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
$VERSION = '0.01'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my $IgnorePattern = $ENV{HARNESS_IGNORE_FILES} ? qr/$ENV{HARNESS_IGNORE_FILES}/ : undef; |
13
|
|
|
|
|
|
|
my $AcceptPattern = $ENV{HARNESS_ACCEPT_FILES} ? qr/$ENV{HARNESS_ACCEPT_FILES}/ : undef; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# Replace _run_all_tests from Test::Harness; |
16
|
|
|
|
|
|
|
{ |
17
|
|
|
|
|
|
|
require Test::Harness; |
18
|
1
|
|
|
1
|
|
5
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
211
|
|
19
|
|
|
|
|
|
|
my $orig_func = \&Test::Harness::_run_all_tests; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
*Test::Harness::_run_all_tests = sub { |
22
|
0
|
|
|
0
|
|
|
my @tests = @_; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# Always comply to ignore first |
25
|
0
|
0
|
|
|
|
|
if (defined $IgnorePattern) { |
26
|
0
|
|
|
|
|
|
@tests = grep { |
27
|
0
|
|
|
|
|
|
my (undef, undef, $filename) = splitpath($_); |
28
|
0
|
|
|
|
|
|
$filename !~ $IgnorePattern; |
29
|
|
|
|
|
|
|
} @tests; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# Then continue filter by accepting those matching next |
33
|
0
|
0
|
|
|
|
|
if (defined $AcceptPattern) { |
34
|
0
|
|
|
|
|
|
@tests = grep { |
35
|
0
|
|
|
|
|
|
my (undef, undef, $filename) = splitpath($_); |
36
|
0
|
|
|
|
|
|
$filename =~ $AcceptPattern; |
37
|
|
|
|
|
|
|
} @tests; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# Run original function |
41
|
0
|
|
|
|
|
|
&$orig_func(@tests); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; # End of Test::Harness::FileFilter |
46
|
|
|
|
|
|
|
__END__ |