This ensures (reasonable) consistency with tests in cpan/, dist/ and ext/,
which set this to qw(../../lib ../../t), but are not from t/, hence don't have
t/ implicitly in @INC as '.'
package TestInit;
-$VERSION = 1.02;
+$VERSION = 1.03;
# Let tests know they're running in the perl core. Useful for modules
# which live dual lives on CPAN.
} else {
chdir 't' or die "Can't chdir 't': $!";
new_inc('../lib');
+ set_opt('../lib') if $0 =~ m!^lib/!;
}
} else {
new_inc('../lib');
foreach (@_) {
if ($_ eq 'U2T') {
@new_inc = @up_2_t;
+ } elsif ($_ eq 'U1') {
+ @new_inc = '../lib';
} elsif ($_ eq 'NC') {
delete $ENV{PERL_CORE}
} elsif ($_ eq 'A') {
$testswitch = $testswitch . ',NC';
}
}
+ } elsif ($test =~ m!^\.\./lib!) {
+ $testswitch = '-I.. -MTestInit=U1'; # -T will remove . from @INC
} else {
$testswitch = '-I.. -MTestInit'; # -T will remove . from @INC
}