From: Rafael Garcia-Suarez Date: Tue, 20 Dec 2005 20:50:26 +0000 (+0000) Subject: Remove some hardcoded references to ./perl in tests X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c8d62b7117d70c1e6d3a6c3c41603445934b9a83;p=p5sagit%2Fp5-mst-13.2.git Remove some hardcoded references to ./perl in tests p4raw-id: //depot/perl@26428 --- diff --git a/t/op/closure.t b/t/op/closure.t index 78087a0..7d8df6a 100755 --- a/t/op/closure.t +++ b/t/op/closure.t @@ -12,6 +12,7 @@ BEGIN { } use Config; +require './test.pl'; # for runperl() print "1..187\n"; @@ -446,8 +447,8 @@ END close READ2; open STDOUT, ">&WRITE" or die "Can't redirect STDOUT: $!"; open STDERR, ">&WRITE2" or die "Can't redirect STDERR: $!"; - exec './perl', '-w', '-' - or die "Can't exec ./perl: $!"; + exec which_perl(), '-w', '-' + or die "Can't exec perl: $!"; } else { # Parent process here. close WRITE; @@ -466,11 +467,7 @@ END my $errfile = "terr$$"; $errfile++ while -e $errfile; my @tmpfiles = ($cmdfile, $errfile); open CMD, ">$cmdfile"; print CMD $code; close CMD; - my $cmd = (($^O eq 'VMS') ? "$^X" - : ($^O eq 'MSWin32') ? '.\perl' - : ($^O eq 'MacOS') ? $^X - : ($^O eq 'NetWare') ? 'perl' - : './perl'); + my $cmd = which_perl(); $cmd .= " -w $cmdfile 2>$errfile"; if ($^O eq 'VMS' or $^O eq 'MSWin32' or $^O eq 'NetWare') { # Use pipe instead of system so we don't inherit STD* from @@ -641,8 +638,6 @@ f16302(); test { $a{7}->()->() + $a{11}->()->() == 18 }; } -require './test.pl'; # for runperl() - { # bugid #23265 - this used to coredump during destruction of PL_maincv # and its children diff --git a/t/op/magic.t b/t/op/magic.t index 54be238..b28a082 100755 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -49,10 +49,11 @@ $Is_MPE = $^O eq 'mpeix'; $Is_miniperl = $ENV{PERL_CORE_MINITEST}; $Is_BeOS = $^O eq 'beos'; -$PERL = ($Is_NetWare ? 'perl' : - ($Is_MacOS || $Is_VMS) ? $^X : - $Is_MSWin32 ? '.\perl' : - './perl'); +$PERL = $ENV{PERL} + || ($Is_NetWare ? 'perl' : + ($Is_MacOS || $Is_VMS) ? $^X : + $Is_MSWin32 ? '.\perl' : + './perl'); eval '$ENV{"FOO"} = "hi there";'; # check that ENV is inited inside eval # cmd.exe will echo 'variable=value' but 4nt will echo just the value diff --git a/t/run/runenv.t b/t/run/runenv.t index 1e36c99..7359c4e 100644 --- a/t/run/runenv.t +++ b/t/run/runenv.t @@ -20,7 +20,7 @@ plan tests => 17; my $STDOUT = './results-0'; my $STDERR = './results-1'; -my $PERL = './perl'; +my $PERL = $ENV{PERL} || './perl'; my $FAILURE_CODE = 119; delete $ENV{PERLLIB};