Skip to content

Commit 8ff38c7

Browse files
authored
Merge pull request #9513 from weliveindetail/lldb-tests-20240723
Allow Swift to enable LLDB tests in Windows CI
2 parents 1ecc38e + 0da07d6 commit 8ff38c7

File tree

69 files changed

+152
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+152
-100
lines changed

lldb/bindings/python/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,24 @@ function(finish_swig_python swig_target lldb_python_bindings_dir lldb_python_tar
198198
COMMENT "Copying Python DLL to LLDB binaries directory.")
199199
endif()
200200

201+
# Since Python3.8 the Windows runtime loads dependent DLLs only from the directory of the binary
202+
# itself (and not Path). Windows has no RPATHs, so we must copy all DLLs that we depend on into
203+
# the Python package.
204+
if (WIN32)
205+
# TARGET_RUNTIME_DLLS is supported in CMake 3.21+
206+
if ("${CMAKE_VERSION}" VERSION_LESS "3.21.0")
207+
if (LLDB_INCLUDE_TESTS)
208+
message(SEND_ERROR
209+
"Your CMake version is ${CMAKE_VERSION}. In order to run LLDB tests "
210+
"on Windows please upgrade to 3.21.0 at least (or disable tests with "
211+
"LLDB_INCLUDE_TESTS=Off)")
212+
endif()
213+
else()
214+
add_custom_command(TARGET ${swig_target} POST_BUILD
215+
COMMAND ${CMAKE_COMMAND} -E copy -t ${lldb_python_target_dir} $<TARGET_RUNTIME_DLLS:liblldb>
216+
COMMAND_EXPAND_LISTS)
217+
endif()
218+
endif()
201219

202220
endfunction()
203221

lldb/packages/Python/lldbsuite/test/dotest.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,6 @@ def parseOptionsAndInitTestdirs():
268268

269269
if args.make:
270270
configuration.make_path = args.make
271-
elif platform_system == "FreeBSD" or platform_system == "NetBSD":
272-
configuration.make_path = "gmake"
273-
else:
274-
configuration.make_path = "make"
275271

276272
if args.dsymutil:
277273
configuration.dsymutil = args.dsymutil

lldb/test/API/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,20 @@ set(LLDB_DEFAULT_TEST_EXECUTABLE "${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb${CMAKE_EXEC
6565

6666
set(LLDB_DEFAULT_TEST_DSYMUTIL "${LLVM_TOOLS_BINARY_DIR}/dsymutil${CMAKE_EXECUTABLE_SUFFIX}")
6767

68+
if(LLDB_TEST_MAKE)
69+
set(LLDB_DEFAULT_TEST_MAKE ${LLDB_TEST_MAKE})
70+
else()
71+
find_program(LLDB_DEFAULT_TEST_MAKE make gmake)
72+
if(LLDB_DEFAULT_TEST_MAKE)
73+
message(STATUS "Found make: ${LLDB_DEFAULT_TEST_MAKE}")
74+
else()
75+
message(STATUS "Not found: make")
76+
message(WARNING
77+
"Many LLDB API tests require 'make' tool. Please provide it in Path "
78+
"or pass via LLDB_TEST_MAKE.")
79+
endif()
80+
endif()
81+
6882
if (TARGET clang)
6983
set(LLDB_DEFAULT_TEST_COMPILER "${LLVM_TOOLS_BINARY_DIR}/clang${CMAKE_EXECUTABLE_SUFFIX}")
7084
else()
@@ -74,6 +88,7 @@ endif()
7488
set(LLDB_TEST_EXECUTABLE "${LLDB_DEFAULT_TEST_EXECUTABLE}" CACHE PATH "lldb executable used for testing")
7589
set(LLDB_TEST_COMPILER "${LLDB_DEFAULT_TEST_COMPILER}" CACHE PATH "C Compiler to use for building LLDB test inferiors")
7690
set(LLDB_TEST_DSYMUTIL "${LLDB_DEFAULT_TEST_DSYMUTIL}" CACHE PATH "dsymutil used for generating dSYM bundles")
91+
set(LLDB_TEST_MAKE "${LLDB_DEFAULT_TEST_MAKE}" CACHE PATH "make tool used for building test executables")
7792

7893
if ("${LLDB_TEST_COMPILER}" STREQUAL "")
7994
message(FATAL_ERROR "LLDB test compiler not specified. Tests will not run.")

lldb/test/API/commands/expression/top-level/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ all: dummy
55
include Makefile.rules
66

77
dummy: dummy.cpp
8-
$(MAKE) -f $(MAKEFILE_RULES) \
8+
"$(MAKE)" -f $(MAKEFILE_RULES) \
99
CXX_SOURCES=dummy.cpp EXE=dummy
1010

lldb/test/API/commands/expression/weak_symbols/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ a.out: libdylib.dylib
99
include Makefile.rules
1010

1111
libdylib.dylib: dylib.c
12-
$(MAKE) -C $(BUILDDIR) -f $(MAKEFILE_RULES) \
12+
"$(MAKE)" -C $(BUILDDIR) -f $(MAKEFILE_RULES) \
1313
C_SOURCES= DYLIB_C_SOURCES=dylib.c DYLIB_NAME=dylib \
1414
CFLAGS_EXTRAS=-DHAS_THEM LD_EXTRAS=-dynamiclib
1515

1616
hidden/libdylib.dylib:
1717
mkdir hidden
18-
$(MAKE) -C $(BUILDDIR)/hidden -f $(MAKEFILE_RULES) \
18+
"$(MAKE)" -C $(BUILDDIR)/hidden -f $(MAKEFILE_RULES) \
1919
C_SOURCES= DYLIB_C_SOURCES=dylib.c DYLIB_NAME=dylib \
2020
LD_EXTRAS=-dynamiclib

lldb/test/API/commands/target/create-deps/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ a.out: libload_a
66
include Makefile.rules
77

88
libload_a:
9-
$(MAKE) -f $(MAKEFILE_RULES) \
9+
"$(MAKE)" -f $(MAKEFILE_RULES) \
1010
DYLIB_ONLY=YES DYLIB_NAME=load_a DYLIB_CXX_SOURCES=a.cpp

lldb/test/API/functionalities/breakpoint/break_in_loaded_dylib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CXX_SOURCES := main.cpp
22
USE_LIBDL := 1
33

44
lib_b:
5-
$(MAKE) -f $(MAKEFILE_RULES) \
5+
"$(MAKE)" -f $(MAKEFILE_RULES) \
66
DYLIB_ONLY=YES DYLIB_CXX_SOURCES=b.cpp DYLIB_NAME=lib_b
77
all: lib_b
88

lldb/test/API/functionalities/completion/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ USE_LIBDL := 1
44
a.out: lib_shared
55

66
lib_shared:
7-
$(MAKE) -f $(MAKEFILE_RULES) \
7+
"$(MAKE)" -f $(MAKEFILE_RULES) \
88
DYLIB_ONLY=YES DYLIB_CXX_SOURCES=shared.cpp DYLIB_NAME=shared
99

1010
include Makefile.rules

lldb/test/API/functionalities/dlopen_other_executable/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ C_SOURCES := main.c
22
USE_LIBDL := 1
33

44
other:
5-
$(MAKE) -f $(MAKEFILE_RULES) C_SOURCES=other.c EXE=other
5+
"$(MAKE)" -f $(MAKEFILE_RULES) C_SOURCES=other.c EXE=other
66
all: other
77

88
include Makefile.rules

lldb/test/API/functionalities/exec/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ all: secondprog
55
include Makefile.rules
66

77
secondprog: secondprog.cpp
8-
$(MAKE) -f $(MAKEFILE_RULES) \
8+
"$(MAKE)" -f $(MAKEFILE_RULES) \
99
CXX_SOURCES=secondprog.cpp EXE=secondprog

0 commit comments

Comments
 (0)