summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TestInit.pm5
-rwxr-xr-xt/TEST2
2 files changed, 6 insertions, 1 deletions
diff --git a/TestInit.pm b/TestInit.pm
index 8513955ab7..a113554068 100644
--- a/TestInit.pm
+++ b/TestInit.pm
@@ -18,7 +18,7 @@
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.
@@ -69,6 +69,7 @@ if (-f 't/TEST' && -f 'MANIFEST' && -d 'lib' && -d 'ext') {
} else {
chdir 't' or die "Can't chdir 't': $!";
new_inc('../lib');
+ set_opt('../lib') if $0 =~ m!^lib/!;
}
} else {
new_inc('../lib');
@@ -80,6 +81,8 @@ sub import {
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') {
diff --git a/t/TEST b/t/TEST
index 945015f6b0..51b6df489c 100755
--- a/t/TEST
+++ b/t/TEST
@@ -246,6 +246,8 @@ sub _scan_test {
$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
}