From a14453b94fa229e50f3dc0e7cc4b9a763b933cb6 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sun, 19 Jun 2011 19:39:07 +0200 Subject: 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]. --- TestInit.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'TestInit.pm') 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 '$_'"; } -- cgit v1.2.1