Skip to content

Commit 5d94d3f

Browse files
committed
[lit] Detect lldb by checking both for lldb_build_root and that that root contains an lldb exec.
Otherwise, if one builds lldb with a specific build-script config and does not fully build lldb, one will not be blocked from testing. With this change, one instead gets a warning that we found a configured lldb dir, but not lldb exec.
1 parent 4a50e23 commit 5d94d3f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/lit.cfg

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ def get_simulator_command(run_os, run_cpu, sdk_path):
100100

101101
def get_lldb_python_path(lldb_build_root):
102102
lldb_path = os.path.join(lldb_build_root, 'bin', 'lldb')
103+
if not os.access(lldb_path, os.F_OK):
104+
return None
103105
return subprocess.check_output([lldb_path, "-P"]).rstrip()
104106

105107
###
@@ -1918,9 +1920,14 @@ config.substitutions.append(('%raw-FileCheck', pipes.quote(config.filecheck)))
19181920
config.substitutions.append(('%import-libdispatch', getattr(config, 'import_libdispatch', '')))
19191921

19201922
if config.lldb_build_root != "":
1921-
config.available_features.add('lldb')
19221923
lldb_python_path = get_lldb_python_path(config.lldb_build_root)
1923-
config.substitutions.append(('%lldb-python-path', lldb_python_path))
1924+
if lldb_python_path == None:
1925+
lit_config.warning("""
1926+
Specified lldb_build_root, but could not find lldb in that build root
1927+
""")
1928+
else:
1929+
config.available_features.add('lldb')
1930+
config.substitutions.append(('%lldb-python-path', lldb_python_path))
19241931

19251932
# Disable randomized hash seeding by default. Tests need to manually opt in to
19261933
# random seeds by unsetting the SWIFT_DETERMINISTIC_HASHING environment

0 commit comments

Comments
 (0)