summaryrefslogtreecommitdiff
path: root/t/TEST
diff options
context:
space:
mode:
authorTim Bunce <Tim.Bunce@pobox.com>2009-12-15 23:04:11 +0000
committerRafael Garcia-Suarez <rgs@consttype.org>2009-12-16 00:29:42 +0100
commit2574563ed1cc89a9149d4a253b94199eab5bdf71 (patch)
tree0f5f721843302439073ce2add6bb4f5eab02ebc9 /t/TEST
parent6a158b577769363e3a34f3dcb7321a0e933d3353 (diff)
downloadperl-2574563ed1cc89a9149d4a253b94199eab5bdf71.tar.gz
Allow override of PERL5OPT etc in t/TEST
Diffstat (limited to 't/TEST')
-rwxr-xr-xt/TEST16
1 files changed, 13 insertions, 3 deletions
diff --git a/t/TEST b/t/TEST
index 6124c5de07..205a8aabff 100755
--- a/t/TEST
+++ b/t/TEST
@@ -99,9 +99,19 @@ $| = 1;
#BEGIN { require '../lib/strict.pm'; "strict"->import() };
#BEGIN { require '../lib/warnings.pm'; "warnings"->import() };
-delete $ENV{PERL5LIB};
-delete $ENV{PERLLIB};
-delete $ENV{PERL5OPT};
+# delete env vars that may influence the results
+# but allow override via *_TEST env var if wanted
+# (e.g. PERL5OPT_TEST=-d:NYTProf)
+for my $envname (qw(PERL5LIB PERLLIB PERL5OPT)) {
+ my $override = $ENV{"${envname}_TEST"};
+ if (defined $override) {
+ warn "$0: $envname=$override\n";
+ $ENV{$envname} = $override;
+ }
+ else {
+ delete $ENV{$envname};
+ }
+}
# remove empty elements due to insertion of empty symbols via "''p1'" syntax
@ARGV = grep($_,@ARGV) if $^O eq 'VMS';