aboutsummaryrefslogtreecommitdiff
path: root/test/lang/c
diff options
context:
space:
mode:
authorDaniel Malea <daniel.malea@intel.com>2012-11-26 21:23:12 +0000
committerDaniel Malea <daniel.malea@intel.com>2012-11-26 21:23:12 +0000
commit99e8729597edabcc603fa41ccf8b80c1a8e58f4b (patch)
tree6cfa7a0204418ccf7db4fcc99835b319e2b8e75c /test/lang/c
parente5aa0d42b55ff6510888c737ef731f3fc1b54bb2 (diff)
downloadlldb-99e8729597edabcc603fa41ccf8b80c1a8e58f4b.tar.gz
Improvement to TestGlobalVariables fix
- use lldb settings command instead of os.environ - use dyldPath fixture variable instead of hardcoding LD_LIBRARY_PATH - add tear-down hook to restore environment after testcase is run git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168613 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/lang/c')
-rw-r--r--test/lang/c/global_variables/TestGlobalVariables.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/lang/c/global_variables/TestGlobalVariables.py b/test/lang/c/global_variables/TestGlobalVariables.py
index 0a355c2a0..27b0a7b25 100644
--- a/test/lang/c/global_variables/TestGlobalVariables.py
+++ b/test/lang/c/global_variables/TestGlobalVariables.py
@@ -24,14 +24,14 @@ class GlobalVariablesTestCase(TestBase):
self.global_variables()
def setUp(self):
- if sys.platform.startswith("linux"):
- # On Linux, environment variable must be set so the shared library is loaded correctly
- os.environ["LD_LIBRARY_PATH"] = os.getcwd()
-
# Call super's setUp().
TestBase.setUp(self)
# Find the line number to break inside main().
self.line = line_number('main.c', '// Set break point at this line.')
+ if sys.platform.startswith("linux"):
+ # On Linux, LD_LIBRARY_PATH must be set so the shared libraries are found on startup
+ self.runCmd("settings set target.env-vars " + self.dylibPath + "=" + os.getcwd())
+ self.addTearDownHook(lambda: self.runCmd("settings remove target.env-vars " + self.dylibPath))
def global_variables(self):
"""Test 'frame variable -s -a' which omits args and shows scopes."""