From e9c7535ad0fcaf974df036b720de4ba061847838 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Tue, 21 Apr 2015 13:50:58 +1000 Subject: [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. --- t/op/dump.t | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 't/op') 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"); -- cgit v1.2.1