1# Module level initialization for the `lldbsuite` module. 2 3import inspect 4import os 5import sys 6 7 8def find_lldb_root(): 9 lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) 10 while True: 11 lldb_root = os.path.dirname(lldb_root) 12 if lldb_root is None: 13 return None 14 15 test_path = os.path.join(lldb_root, "use_lldb_suite_root.py") 16 if os.path.isfile(test_path): 17 return lldb_root 18 return None 19 20# lldbsuite.lldb_root refers to the root of the git/svn source checkout 21lldb_root = find_lldb_root() 22 23# lldbsuite.lldb_test_root refers to the root of the python test tree 24lldb_test_root = os.path.join( 25 lldb_root, 26 "packages", 27 "Python", 28 "lldbsuite", 29 "test") 30