From 19641fd71ab87a4234f86f69f958b61278dbdade Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Fri, 7 Apr 2017 08:46:13 +0100 Subject: stop passing '.' in @INC to tests Currently TestInit.pm adds '.' to @INC (except if running under taint). Since *all* tests run from the perl core are invoked as perl -MTestInit[=arg,arg,..] some/test.t this means that all test scripts (including those under cpan/ etc) are excuted with dot present, regardless of the settings of $PERL_USE_UNSAFE_INC and -Ddefault_inc_excludes_dot. This commit changes it so that: 1) TestInit.pm transparently passes though a trailing dot in @INC if present (so it now honours $PERL_USE_UNSAFE_INC and -Ddefault_inc_excludes_dot) 2) Adds a 'DOT' arg (e.g. -MTestInit=DOT) which unconditionally adds '.'; 3) Updates t/TEST so that it (and t/harness which requires t/TEST) have a whitelist of cpan/ modules which need '.'; test scripts for these are invoked with -MTestInit=DOT. 4) Removes the $PERL_USE_UNSAFE_INC unsetting in t/TEST and t/harness; now that environmant variable is passed unchanged to all perl processes involved in running the test suite. As of this commit, lots of tests will fail on a dotless perl build; the next few commits will fix up any tests scripts and non cpan/ distributions which relied on dot being present. --- t/harness | 3 --- 1 file changed, 3 deletions(-) (limited to 't/harness') diff --git a/t/harness b/t/harness index e06c3f8009..b46582ddd9 100644 --- a/t/harness +++ b/t/harness @@ -34,9 +34,6 @@ if ($ARGV[0] && $ARGV[0] eq '-torture') { # which live dual lives on CPAN. $ENV{PERL_CORE} = 1; -# All our tests should work without . in @INC -delete $ENV{PERL_USE_UNSAFE_INC}; - my (@tests, $re); # [.VMS]TEST.COM calls harness with empty arguments, so clean-up @ARGV -- cgit v1.2.1