[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Thu Apr 7 14:28:11 UTC 2016


The branch master has been updated
       via  d1094383df07cc8ae266c04cf3ace782447b4d5b (commit)
      from  1d352bb192d72af1d09c57025dcc9c30fbccc7e9 (commit)


- Log -----------------------------------------------------------------
commit d1094383df07cc8ae266c04cf3ace782447b4d5b
Author: Richard Levitte <levitte at openssl.org>
Date:   Thu Apr 7 14:30:15 2016 +0200

    OpenSSL::Test: when moving directory, affect env as well
    
    The environment variables TOP, SRCTOP, BLDTOP, ...  are used to affect
    the testing framework.  However, subprocesses may want to use them as
    well, and therefore need their values corrected when we move to a
    different directory.
    
    Reviewed-by: Emilia Käsper <emilia at openssl.org>

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

Summary of changes:
 test/testlib/OpenSSL/Test.pm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/test/testlib/OpenSSL/Test.pm b/test/testlib/OpenSSL/Test.pm
index ca2e369..28c915a 100644
--- a/test/testlib/OpenSSL/Test.pm
+++ b/test/testlib/OpenSSL/Test.pm
@@ -60,6 +60,11 @@ my $test_name = undef;
 # (mandatory), BIN_D, TEST_D, UTIL_D and RESULT_D.
 my %directories = ();
 
+# The environment variables that gave us the contents in %directories.  These
+# get modified whenever we change directories, so that subprocesses can use
+# the values of those environment variables as well
+my @direnv = ();
+
 # A bool saying if we shall stop all testing if the current recipe has failing
 # tests or not.  This is set by setup() if the environment variable STOPTEST
 # is defined with a non-empty value.
@@ -674,6 +679,13 @@ sub __env {
     $directories{SRCTEST} =                 __srctop_dir("test");
     $directories{RESULTS} = $ENV{RESULT_D} || $directories{BLDTEST};
 
+    push @direnv, "TOP"       if $ENV{TOP};
+    push @direnv, "SRCTOP"    if $ENV{SRCTOP};
+    push @direnv, "BLDTOP"    if $ENV{BLDTOP};
+    push @direnv, "BIN_D"     if $ENV{BIN_D};
+    push @direnv, "TEST_D"    if $ENV{TEST_D};
+    push @direnv, "RESULT_D"  if $ENV{RESULT_D};
+
     $end_with_bailout	  = $ENV{STOPTEST} ? 1 : 0;
 };
 
@@ -801,6 +813,16 @@ sub __cwd {
 	}
     }
 
+    # Treat each environment variable that was used to get us the values in
+    # %directories the same was as the paths in %directories, so any sub
+    # process can use their values properly as well
+    foreach (@direnv) {
+	if (!file_name_is_absolute($ENV{$_})) {
+	    my $newpath = abs2rel(rel2abs($ENV{$_}), rel2abs($dir));
+	    $ENV{$_} = $newpath;
+	}
+    }
+
     if ($debug) {
 	print STDERR "DEBUG: __cwd(), directories and files:\n";
 	print STDERR "  \$directories{BLDTEST} = \"$directories{BLDTEST}\"\n";


More information about the openssl-commits mailing list