Skip to content

Commit 39d4e16

Browse files
mgornyldionne
authored andcommitted
[libc++][test] Propagate host environment to libc++ test suite
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. #56816 Differential Revision: https://reviews.llvm.org/D130843
1 parent 495519e commit 39d4e16

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

libcxx/test/libcxx/selftest/dsl/dsl.sh.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def setUp(self):
6464
params={})
6565

6666
self.config = lit.TestingConfig.TestingConfig.fromdefaults(self.litConfig)
67+
self.config.environment = dict(os.environ)
6768
self.config.test_source_root = SOURCE_ROOT
6869
self.config.test_exec_root = EXEC_PATH
6970
self.config.recursiveExpansionLimit = 10

libcxx/utils/libcxx/test/newconfig.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#
77
#===----------------------------------------------------------------------===##
88

9+
import os
10+
11+
912
def _getSubstitution(substitution, config):
1013
for (orig, replacement) in config.substitutions:
1114
if orig == substitution:
@@ -14,6 +17,7 @@ def _getSubstitution(substitution, config):
1417

1518
def configure(parameters, features, config, lit_config):
1619
note = lambda s: lit_config.note("({}) {}".format(config.name, s))
20+
config.environment = dict(os.environ)
1721

1822
# Apply the actions supplied by parameters to the configuration first, since
1923
# parameters are things that we request explicitly and which might influence

0 commit comments

Comments
 (0)