aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite/test/lldbtest.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 85d2bed..fe501f6 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -496,7 +496,7 @@ class Base(unittest2.TestCase):
mydir = TestBase.compute_mydir(__file__)
'''
# /abs/path/to/packages/group/subdir/mytest.py -> group/subdir
- rel_prefix = test_file[len(os.environ["LLDB_TEST_SRC"]) + 1:]
+ rel_prefix = test_file[len(configuration.test_src_root) + 1:]
return os.path.dirname(rel_prefix)
def TraceOn(self):
@@ -520,15 +520,11 @@ class Base(unittest2.TestCase):
# Save old working directory.
cls.oldcwd = os.getcwd()
- # Change current working directory if ${LLDB_TEST_SRC} is defined.
- # See also dotest.py which sets up ${LLDB_TEST_SRC}.
- if ("LLDB_TEST_SRC" in os.environ):
- full_dir = os.path.join(os.environ["LLDB_TEST_SRC"],
- cls.mydir)
- if traceAlways:
- print("Change dir to:", full_dir, file=sys.stderr)
- os.chdir(full_dir)
- lldb.SBReproducer.SetWorkingDirectory(full_dir)
+ full_dir = os.path.join(configuration.test_src_root, cls.mydir)
+ if traceAlways:
+ print("Change dir to:", full_dir, file=sys.stderr)
+ os.chdir(full_dir)
+ lldb.SBReproducer.SetWorkingDirectory(full_dir)
# Set platform context.
cls.platformContext = lldbplatformutil.createPlatformContext()
@@ -662,7 +658,7 @@ class Base(unittest2.TestCase):
def getSourceDir(self):
"""Return the full path to the current test."""
- return os.path.join(os.environ["LLDB_TEST_SRC"], self.mydir)
+ return os.path.join(configuration.test_src_root, self.mydir)
def getBuildDirBasename(self):
return self.__class__.__module__ + "." + self.testMethodName
@@ -1098,7 +1094,7 @@ class Base(unittest2.TestCase):
<session-dir>/<arch>-<compiler>-<test-file>.<test-class>.<test-method>
"""
- dname = os.path.join(os.environ["LLDB_TEST_SRC"],
+ dname = os.path.join(configuration.test_src_root,
os.environ["LLDB_SESSION_DIRNAME"])
if not os.path.isdir(dname):
os.mkdir(dname)