Skip to content

Commit 54c7f58

Browse files
[lldb][swift] Check runtime dependencies of SwiftREPL tests in local lit config
These binaries only exists if the Swift runtime was built correctly. We cannot check them at configuration time, because they might not exist yet.
1 parent 266bc21 commit 54c7f58

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lldb/test/Shell/SwiftREPL/lit.local.cfg

+11
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,14 @@ config.suffixes = ['.test']
22

33
if 'lldb-repro' in config.available_features:
44
config.unsupported = True
5+
6+
def check_exists(path):
7+
import os
8+
if not os.path.isfile(path):
9+
lit_config.warning(f"Runtime dependency not found: {path}")
10+
11+
# Check runtime dependencies for SwiftREPL tests on Windows
12+
if sys.platform == "win32":
13+
host_arch = config.host_triple.split("-")[0]
14+
check_exists(f"{config.swift_libs_dir}/windows/{host_arch}/swiftrt.obj")
15+
check_exists(f"{config.llvm_shlib_dir}/swiftCore.dll")

lldb/test/Shell/lit.site.cfg.py.in

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ config.cmake_sysroot = lit_config.substitute("@CMAKE_SYSROOT@")
1717
config.target_triple = "@LLVM_TARGET_TRIPLE@"
1818
config.python_executable = "@Python3_EXECUTABLE@"
1919
config.swiftc = "@LLDB_SWIFTC@"
20+
config.swift_libs_dir = '@LLDB_SWIFT_LIBS@'
2021
config.lldb_enable_swift = @LLDB_ENABLE_SWIFT_SUPPORT@
2122
config.have_zlib = @LLVM_ENABLE_ZLIB@
2223
config.objc_gnustep_dir = "@LLDB_TEST_OBJC_GNUSTEP_DIR@"

0 commit comments

Comments
 (0)