The branch master has been updated
       via  349232d149804dae09987af7612000e30ee7c4cc (commit)
       via  d8a52304ae704edb6a5619b6a1604821b75bee50 (commit)
      from  580731aff3fc9855ea93ea734bd924febea027c3 (commit)


- Log -----------------------------------------------------------------
commit 349232d149804dae09987af7612000e30ee7c4cc
Author: Richard Levitte <[email protected]>
Date:   Thu Mar 31 15:08:34 2016 +0200

    OpenSSL::Test: have cmdstr() return the true command.
    
    On the other hand, have run() display the display variant.
    
    Reviewed-by: Rich Salz <[email protected]>

commit d8a52304ae704edb6a5619b6a1604821b75bee50
Author: Richard Levitte <[email protected]>
Date:   Thu Mar 31 15:02:02 2016 +0200

    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 <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 test/testlib/OpenSSL/Test.pm | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/test/testlib/OpenSSL/Test.pm b/test/testlib/OpenSSL/Test.pm
index c2b9f5c..b0a609f 100644
--- a/test/testlib/OpenSSL/Test.pm
+++ b/test/testlib/OpenSSL/Test.pm
@@ -354,7 +354,7 @@ sub run {
        $r = $hooks{exit_checker}->($e);
     }
 
-    print STDERR "$prefix$cmd => $e\n"
+    print STDERR "$prefix$display_cmd => $e\n"
         if !$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE};
 
     # At this point, $? stops being interesting, and unfortunately,
@@ -560,7 +560,7 @@ command as a string.
 sub cmdstr {
     my ($cmd, $display_cmd) = shift->(0);
 
-    return $display_cmd;
+    return $cmd;
 }
 
 =over 4
@@ -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;
        }
_____
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits

Reply via email to