Add the LD_LIBRARY_PATH to target.env-vars for tests expecting libimf.so when testing with ICC.

Patch from Andy Kaylor.

llvm-svn: 187520
This commit is contained in:
Matt Kopec
2013-07-31 20:13:04 +00:00
parent 130a5593a8
commit 9a9aa228a8
3 changed files with 14 additions and 3 deletions

View File

@@ -30,7 +30,10 @@ class GlobalVariablesTestCase(TestBase):
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())
if "LD_LIBRARY_PATH" in os.environ:
self.runCmd("settings set target.env-vars " + self.dylibPath + "=" + os.environ["LD_LIBRARY_PATH"] + ":" + os.getcwd())
else:
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):
@@ -43,6 +46,8 @@ class GlobalVariablesTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
self.runCmd("process status", "Get process status")
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs = ['stopped',

View File

@@ -40,7 +40,10 @@ class SharedLibTestCase(TestBase):
# Find the line number to break inside main().
self.line = line_number('main.c', '// Set breakpoint 0 here.')
if sys.platform.startswith("linux"):
self.runCmd("settings set target.env-vars " + self.dylibPath + "=" + os.getcwd())
if "LD_LIBRARY_PATH" in os.environ:
self.runCmd("settings set target.env-vars " + self.dylibPath + "=" + os.environ["LD_LIBRARY_PATH"] + ":" + os.getcwd())
else:
self.runCmd("settings set target.env-vars " + self.dylibPath + "=" + os.getcwd())
self.addTearDownHook(lambda: self.runCmd("settings remove target.env-vars " + self.dylibPath))
def common_setup(self):

View File

@@ -40,7 +40,10 @@ class SharedLibTestCase(TestBase):
# Find the line number to break inside main().
self.line = line_number('main.c', '// Set breakpoint 0 here.')
if sys.platform.startswith("linux"):
self.runCmd("settings set target.env-vars " + self.dylibPath + "=" + os.getcwd())
if "LD_LIBRARY_PATH" in os.environ:
self.runCmd("settings set target.env-vars " + self.dylibPath + "=" + os.environ["LD_LIBRARY_PATH"] + ":" + os.getcwd())
else:
self.runCmd("settings set target.env-vars " + self.dylibPath + "=" + os.getcwd())
self.addTearDownHook(lambda: self.runCmd("settings remove target.env-vars " + self.dylibPath))
def common_setup(self):