From 2fa67f442a373db61c74a93fe7272f60e50bf6bc Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Thu, 25 Jul 2019 20:54:41 +0000 Subject: [dotest] Set environment variables after potentialy clearing others. Dotest contains code to clear DYLD_LIBRARY_PATH for the inferior to not propagate sanitized builds. However, it's possible that we want to inject a different library path with `--inferior-env`. To make that work correctly, we need to do that *after* clearing DYLD_LIBRARY_PATH. llvm-svn: 367054 --- lldb/packages/Python/lldbsuite/test/lldbtest.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py') diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py index a252644735c..daa56e7ba49 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbtest.py +++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -1851,9 +1851,6 @@ class TestBase(Base): # decorators. Base.setUp(self) - if lldbtest_config.inferior_env: - self.runCmd('settings set target.env-vars {}'.format(lldbtest_config.inferior_env)) - # Set the clang modules cache path used by LLDB. mod_cache = os.path.join(os.environ["LLDB_BUILD"], "module-cache-lldb") self.runCmd('settings set symbols.clang-modules-cache-path "%s"' @@ -1871,6 +1868,10 @@ class TestBase(Base): if 'DYLD_LIBRARY_PATH' in os.environ: self.runCmd('settings set target.env-vars DYLD_LIBRARY_PATH=') + # Set environment variables for the inferior. + if lldbtest_config.inferior_env: + self.runCmd('settings set target.env-vars {}'.format(lldbtest_config.inferior_env)) + if "LLDB_MAX_LAUNCH_COUNT" in os.environ: self.maxLaunchCount = int(os.environ["LLDB_MAX_LAUNCH_COUNT"]) -- cgit v1.2.3