Explicitly add -I../lib to the switches, rather than rely on TAP::Harness or
Test::Harness picking -I../lib up from $ENV{PERL5LIB}. (Test::Harness hasn't
changed, but TAP::Harness has). Test::Harness does, however, spot that we've
altered our own @INC, and passes this on to tests. So there is no need to set
$ENV{PERL5LIB} to effect changes to @INC in tests. So don't set $ENV{PERL5LIB}
to -I../lib. Instead set it to '', to avoid contamination from our environment.
BEGIN {
chdir 't' if -d 't';
@INC = '../lib'; # pick up only this build's lib
- $ENV{PERL5LIB} = '../lib'; # so children will see it too
}
+delete $ENV{PERL5LIB};
my $torture; # torture testing?
}
);
}
+ $h->callback(
+ parser_args => sub {
+ my ( $args, $test ) = @_;
+ push @{ $args->{switches} }, '-I../lib';
+ }
+ );
$h->runtests(@tests);
} else {
Test::Harness::runtests @tests;