Skip to content
Permalink
Browse files

Fix bug in 'use lib' filtering in harness5

  • Loading branch information...
pmurias committed Jan 16, 2019
1 parent ec289a6 commit bb36f04a68a1796f763241e849ab6e462bcbd661
Showing with 20 additions and 10 deletions.
  1. +20 −10 t/harness5
@@ -86,16 +86,6 @@ my @tfiles = $randomize
? shuffle map { all_in($_) } @files
: map { all_in($_) } sort @files;

if ($precompile) {
@tfiles = grep {
my $seen_use_lib = 0;
open(my $fh, '<', $_);
while (my $line = <$fh>) {
$seen_use_lib = 1 if $line =~ /^\s*use lib/;
}
!$seen_use_lib;
} @tfiles;
}

if (@slow) {
@slow = map { all_in($_) } @slow;
@@ -113,6 +103,26 @@ if ($do_fudge) {
@tfiles = map { fudge(@$_) } batch( 200, @tfiles );
}

sub has_use_lib {
my ($file) = @_;
my $seen_use_lib = 0;
open(my $fh, '<', $file);
while (my $line = <$fh>) {
$seen_use_lib = 1 if $line =~ /^\s*use lib/;
}
$seen_use_lib;
}

if ($precompile) {
@tfiles = map {
if (ref $_) {
[grep {!has_use_lib($_)} @$_];
} else {
has_use_lib($_) ? () : $_;
}
} @tfiles;
}

my $tap_harness_class = 'TAP::Harness';
$tap_harness_class .= '::Archive' if $archive;

0 comments on commit bb36f04

Please sign in to comment.
You can’t perform that action at this time.