mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-12 13:37:16 +00:00

Summary: This creates a separate LLDB_TEST_SRC var to match the existing LLDB_TEST var. LLDB_TEST points to the test framework, LLDB_TEST_SRC points to the tests themselves. The var points to the same place, but a future patch will move the tree + update var. Reviewers: labath, JDevlieghere Reviewed By: labath Subscribers: merge_guards_bot, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71150
33 lines
912 B
Python
33 lines
912 B
Python
# Module level initialization for the `lldbsuite` module.
|
|
|
|
import inspect
|
|
import os
|
|
import sys
|
|
|
|
|
|
def find_lldb_root():
|
|
lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe()))
|
|
while True:
|
|
lldb_root = os.path.dirname(lldb_root)
|
|
if lldb_root is None:
|
|
return None
|
|
|
|
test_path = os.path.join(lldb_root, "use_lldb_suite_root.py")
|
|
if os.path.isfile(test_path):
|
|
return lldb_root
|
|
return None
|
|
|
|
# lldbsuite.lldb_root refers to the root of the git/svn source checkout
|
|
lldb_root = find_lldb_root()
|
|
|
|
# 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")
|