diff options
author | Richard Levitte <levitte@openssl.org> | 2016-03-31 15:02:02 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-03-31 19:54:37 +0200 |
commit | d8a52304ae704edb6a5619b6a1604821b75bee50 (patch) | |
tree | 596019329dd10d0fb970e93786d0f406125e2927 /test/testlib | |
parent | 580731aff3fc9855ea93ea734bd924febea027c3 (diff) |
When looking for executables, don't forget the extension
Because some operating systems have executable extensions, typically
".exe", we need to append it when looking for files in test() and
app() (or rather, their subroutines).
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test/testlib')
-rw-r--r-- | test/testlib/OpenSSL/Test.pm | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/test/testlib/OpenSSL/Test.pm b/test/testlib/OpenSSL/Test.pm index c2b9f5c589..53a15c4fa5 100644 --- a/test/testlib/OpenSSL/Test.pm +++ b/test/testlib/OpenSSL/Test.pm @@ -680,10 +680,20 @@ sub __bldtop_dir { return catdir($directories{BLDTOP},@_); } +sub __exeext { + my $ext = ""; + if ($^O eq "VMS" ) { # VMS + $ext = ".exe"; + } elsif ($^O eq "MSWin32") { # Windows + $ext = ".exe"; + } + return $ENV{"EXE_EXT"} || $ext; +} + sub __test_file { BAIL_OUT("Must run setup() first") if (! $test_name); - my $f = pop; + my $f = pop . __exeext(); $f = catfile($directories{BLDTEST},@_,$f); $f = catfile($directories{SRCTEST},@_,$f) unless -x $f; return $f; @@ -701,7 +711,7 @@ sub __perltest_file { sub __apps_file { BAIL_OUT("Must run setup() first") if (! $test_name); - my $f = pop; + my $f = pop . __exeext(); $f = catfile($directories{BLDAPPS},@_,$f); $f = catfile($directories{SRCAPPS},@_,$f) unless -x $f; return $f; @@ -790,23 +800,20 @@ sub __fixup_cmd { my $exe_shell = shift; my $prefix = __bldtop_file("util", "shlib_wrap.sh")." "; - my $ext = $ENV{"EXE_EXT"} || ""; if (defined($exe_shell)) { $prefix = "$exe_shell "; } elsif ($^O eq "VMS" ) { # VMS $prefix = ($prog =~ /^(?:[\$a-z0-9_]+:)?[<\[]/i ? "mcr " : "mcr []"); - $ext = ".exe"; } elsif ($^O eq "MSWin32") { # Windows $prefix = ""; - $ext = ".exe"; } # We test both with and without extension. The reason # is that we might be passed a complete file spec, with # extension. if ( ! -x $prog ) { - my $prog = "$prog$ext"; + my $prog = "$prog"; if ( ! -x $prog ) { $prog = undef; } |