summaryrefslogtreecommitdiff
path: root/TestInit.pm
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-06-19 19:39:07 +0200
committerNicholas Clark <nick@ccl4.org>2011-06-22 22:41:13 +0200
commita14453b94fa229e50f3dc0e7cc4b9a763b933cb6 (patch)
tree42120e769e23d03e21f6d00d3414b1fb895539da /TestInit.pm
parentb6800926e4030bbaf8f4b22cba1727acaf7da13e (diff)
downloadperl-a14453b94fa229e50f3dc0e7cc4b9a763b933cb6.tar.gz
Add an import option 'T' to TestInit, for tests that run at the top level.
This sets @INC to 'lib, and unless we're already at the top level will chdir '..' [on the assumption that we are starting in t].
Diffstat (limited to 'TestInit.pm')
-rw-r--r--TestInit.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/TestInit.pm b/TestInit.pm
index 88c3ba1849..c921686bac 100644
--- a/TestInit.pm
+++ b/TestInit.pm
@@ -69,6 +69,11 @@ sub import {
delete $ENV{PERL_CORE}
} elsif ($_ eq 'A') {
$abs = 1;
+ } elsif ($_ eq 'T') {
+ $chdir = '..'
+ unless -f 't/TEST' && -f 'MANIFEST' && -d 'lib' && -d 'ext';
+ @new_inc = 'lib';
+ $setopt = 1;
} else {
die "Unknown option '$_'";
}