diff --git a/lldb/packages/Python/lldbsuite/__init__.py b/lldb/packages/Python/lldbsuite/__init__.py --- a/lldb/packages/Python/lldbsuite/__init__.py +++ b/lldb/packages/Python/lldbsuite/__init__.py @@ -20,10 +20,13 @@ # lldbsuite.lldb_root refers to the root of the git/svn source checkout lldb_root = find_lldb_root() -# lldbsuite.lldb_test_root refers to the root of the python test tree +# lldbsuite.lldb_test_src_root refers to the root of the python test case tree +# (i.e. the actual unit tests). lldb_test_root = os.path.join( lldb_root, "packages", "Python", "lldbsuite", "test") +# TODO(rupprecht): update the above definition after moving test cases: +# lldb_test_root = os.path.join(lldb_root, "test", "API") diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -504,6 +504,7 @@ sys.exit(-1) os.environ["LLDB_TEST"] = scriptPath + os.environ["LLDB_TEST_SRC"] = lldbsuite.lldb_test_root # Set up the root build directory. builddir = configuration.test_build_dir diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py --- a/lldb/packages/Python/lldbsuite/test/lldbtest.py +++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -498,7 +498,7 @@ mydir = TestBase.compute_mydir(__file__) ''' # /abs/path/to/packages/group/subdir/mytest.py -> group/subdir - rel_prefix = test_file[len(os.environ["LLDB_TEST"]) + 1:] + rel_prefix = test_file[len(os.environ["LLDB_TEST_SRC"]) + 1:] return os.path.dirname(rel_prefix) def TraceOn(self): @@ -518,10 +518,10 @@ # Save old working directory. cls.oldcwd = os.getcwd() - # Change current working directory if ${LLDB_TEST} is defined. - # See also dotest.py which sets up ${LLDB_TEST}. - if ("LLDB_TEST" in os.environ): - full_dir = os.path.join(os.environ["LLDB_TEST"], + # 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) @@ -656,7 +656,7 @@ def getSourceDir(self): """Return the full path to the current test.""" - return os.path.join(os.environ["LLDB_TEST"], self.mydir) + return os.path.join(os.environ["LLDB_TEST_SRC"], self.mydir) def getBuildDirBasename(self): return self.__class__.__module__ + "." + self.testMethodName @@ -1089,7 +1089,7 @@ /--.. """ - dname = os.path.join(os.environ["LLDB_TEST"], + dname = os.path.join(os.environ["LLDB_TEST_SRC"], os.environ["LLDB_SESSION_DIRNAME"]) if not os.path.isdir(dname): os.mkdir(dname) diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py --- a/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py +++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py @@ -61,12 +61,13 @@ # Construct the base make invocation. lldb_test = os.environ["LLDB_TEST"] + lldb_test_src = os.environ["LLDB_TEST_SRC"] lldb_build = os.environ["LLDB_BUILD"] - if not (lldb_test and lldb_build and test_subdir and test_name and - (not os.path.isabs(test_subdir))): + if not (lldb_test and lldb_test_src and lldb_build and test_subdir and + test_name and (not os.path.isabs(test_subdir))): raise Exception("Could not derive test directories") build_dir = os.path.join(lldb_build, test_subdir, test_name) - src_dir = os.path.join(lldb_test, test_subdir) + src_dir = os.path.join(lldb_test_src, test_subdir) # This is a bit of a hack to make inline testcases work. makefile = os.path.join(src_dir, "Makefile") if not os.path.isfile(makefile):