Subject: | "blib" does not ignore test files in Devel::Cover 0.73 |
If either the"blib" directory exists or the "-blib" option is true, patterns to ignore test files are
pushed onto the @Ignore array at line 328 of Cover.pm. However, mapping the @Ignore array
into the @Ignore_re array (which is used for the actual filtering) is done before that at line 299,
so the additional test file patterns do not get used. Patch is attached.
Subject: | Cover.pm.patch |
*** Cover.pm.orig 2011-02-19 12:18:25.000000000 -0700
--- Cover.pm.new 2011-02-19 12:19:21.000000000 -0700
***************
*** 294,299 ****
--- 294,306 ----
warn __PACKAGE__ . ": Unknown option $_ ignored\n";
}
+ if ($blib)
+ {
+ eval "use blib";
+ for (@INC) { $_ = $1 if /(.*)/ } # Die tainting.
+ push @Ignore, "^t/", '\\.t$', '^test\\.pl$';
+ }
+
my $ci = $^O eq "MSWin32";
@Select_re = map qr/$_/, @Select;
@Ignore_re = map qr/$_/, @Ignore;
***************
*** 321,333 ****
$DB = $1 if abs_path($DB) =~ /(.*)/;
Devel::Cover::DB->delete($DB) unless $Merge;
- if ($blib)
- {
- eval "use blib";
- for (@INC) { $_ = $1 if /(.*)/ } # Die tainting.
- push @Ignore, "^t/", '\\.t$', '^test\\.pl$';
- }
-
%Files = (); # start gathering file information from scratch
for my $c (Devel::Cover::DB->new->criteria)
--- 328,333 ----