[libcxx-commits] [PATCH] D130843: [libcxx] [test] Propagate host environment to libc++ test suite

Michał Górny via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 31 07:51:56 PDT 2022


mgorny created this revision.
mgorny added a reviewer: ldionne.
Herald added a subscriber: arichardson.
Herald added a project: All.
mgorny requested review of this revision.

Propagate the complete host environment to the tests run via the new
testconfig.  This ensures that all envvars needed e.g. for the compiler
to work correctly are present.  This mimics the behavior explicitly
implemented in the legacy config.

https://github.com/llvm/llvm-project/issues/56816


https://reviews.llvm.org/D130843

Files:
  libcxx/test/libcxx/selftest/dsl/dsl.sh.py
  libcxx/utils/libcxx/test/newconfig.py


Index: libcxx/utils/libcxx/test/newconfig.py
===================================================================
--- libcxx/utils/libcxx/test/newconfig.py
+++ libcxx/utils/libcxx/test/newconfig.py
@@ -6,6 +6,9 @@
 #
 #===----------------------------------------------------------------------===##
 
+import os
+
+
 def _getSubstitution(substitution, config):
   for (orig, replacement) in config.substitutions:
     if orig == substitution:
@@ -14,6 +17,7 @@
 
 def configure(parameters, features, config, lit_config):
   note = lambda s: lit_config.note("({}) {}".format(config.name, s))
+  config.environment = dict(os.environ)
 
   # Apply the actions supplied by parameters to the configuration first, since
   # parameters are things that we request explicitly and which might influence
Index: libcxx/test/libcxx/selftest/dsl/dsl.sh.py
===================================================================
--- libcxx/test/libcxx/selftest/dsl/dsl.sh.py
+++ libcxx/test/libcxx/selftest/dsl/dsl.sh.py
@@ -64,6 +64,7 @@
             params={})
 
         self.config = lit.TestingConfig.TestingConfig.fromdefaults(self.litConfig)
+        self.config.environment = dict(os.environ)
         self.config.test_source_root = SOURCE_ROOT
         self.config.test_exec_root = EXEC_PATH
         self.config.recursiveExpansionLimit = 10


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130843.448860.patch
Type: text/x-patch
Size: 1331 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220731/f9fd5859/attachment.bin>


More information about the libcxx-commits mailing list