summaryrefslogtreecommitdiff
path: root/t/op
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2015-04-21 13:50:58 +1000
committerTony Cook <tony@develop-help.com>2015-04-23 10:02:58 +1000
commite9c7535ad0fcaf974df036b720de4ba061847838 (patch)
tree796f126d13f1fc418cc648547cbc8b2f1069c470 /t/op
parenta8f582bba994bddcc79d5064ab06171208405139 (diff)
downloadperl-e9c7535ad0fcaf974df036b720de4ba061847838.tar.gz
[perl #124357] make sure which_perl() can find ./perl on in op/dump.t
OpenBSD doesn't set $^X to an absolute path. and since op/dump.t chdir()s to a temp directory, which_perl() produced "./perl" which is useless in the new directory. Instead manually set $^X to an absolute path so which_perl() can find it after the chdir. This should be safe on the platforms we allow op/dump.t to run on.
Diffstat (limited to 't/op')
-rw-r--r--t/op/dump.t6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/op/dump.t b/t/op/dump.t
index 1db16373de..7c5c3af898 100644
--- a/t/op/dump.t
+++ b/t/op/dump.t
@@ -13,6 +13,7 @@ BEGIN {
use Config;
use File::Temp qw(tempdir);
use Cwd qw(getcwd);
+use File::Spec;
skip_all("only tested on devel builds")
unless $Config{usedevel};
@@ -33,6 +34,11 @@ my $tmp = tempdir(CLEANUP => 1);
my $start = getcwd;
+# on systems which don't make $^X absolute which_perl() in test.pl won't
+# return an absolute path, so once we change directories it can't
+# find ./perl, resulting in test failures
+$^X = File::Spec->rel2abs($^X);
+
chdir $tmp
or skip_all("Cannot chdir to work directory");