blob: 3dbcbb917005420753a20fd5d2a35fedcd819004 [file] [log] [blame]
Zachary Turner8741e312015-10-20 21:05:57 +00001import inspect
2import os
3import sys
4
5def find_lldb_root():
6 lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe()))
7 while True:
8 lldb_root = os.path.dirname(lldb_root)
9 if lldb_root is None:
10 return None
11
12 test_path = os.path.join(lldb_root, "lldb.root")
13 if os.path.isfile(test_path):
14 return lldb_root
15 return None
16
17lldb_root = find_lldb_root()
18if lldb_root is not None:
19 import imp
Zachary Turner0a0490b2015-10-27 20:12:05 +000020 module = imp.find_module("use_lldb_suite_root", [lldb_root])
Zachary Turner8741e312015-10-20 21:05:57 +000021 if module is not None:
Zachary Turneraf383ff2015-10-27 22:33:47 +000022 imp.load_module("use_lldb_suite_root", *module)