Skip to content

Commit c4f0d1e

Browse files
authored
Swift to SPM generation of LinuxMain and manifest files. (#17)
1 parent f337387 commit c4f0d1e

File tree

3 files changed

+1108
-1061
lines changed

3 files changed

+1108
-1061
lines changed

Tests/CMakeLists.txt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ get_filename_component(LINUX_MAIN ${LINUX_MAIN} ABSOLUTE BASE_DIR ${CMAKE_SOURCE
1717
#
1818
add_custom_target(tests ALL
1919
COMMAND swift test
20-
DEPENDS build
20+
DEPENDS build generate-tests ${TEST_FILES}
2121
SOURCES ${TEST_FILES} ${CMAKE_SOURCE_DIR}/Package.swift
2222
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
2323
)
@@ -85,22 +85,18 @@ add_custom_target(generate-tests
8585
DEPENDS generate-BinaryEncodingKeyedContainerNegativeTests generate-BinaryEncodingKeyedContainerTests generate-BinaryEncodingSingleValueContainerNegativeTests generate-BinaryEncodingSingleValueContainerTests generate-BinaryEncodingUnkeyedContainerNegativeTests generate-BinaryEncodingUnkeyedContainerTests generate-EncodedTypeTests generate-SingleValueContainerTests
8686
)
8787

88-
add_dependencies(tests generate-tests)
89-
9088
#
9189
# Build the LinuxMain file.
9290
#
9391
# Note: We do this for all platforms so that we are assured that it is maintained whenever a change is made to the tests.
9492
#
9593
add_custom_command(
96-
DEPENDS build-tools
94+
DEPENDS tests generate-tests
9795
OUTPUT "${LINUX_MAIN}"
98-
COMMAND "${BUILD_TOOLS_BIN}/xctest_tool.rb"
99-
ARGS --package-path "${CMAKE_SOURCE_DIR}"
100-
VERBATIM
96+
COMMAND swift test --generate-linuxmain
97+
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
10198
)
10299

103100
add_custom_target(linux-main
104-
DEPENDS "${LINUX_MAIN}" generate-tests
101+
DEPENDS "${LINUX_MAIN}"
105102
)
106-
add_dependencies(tests linux-main)

0 commit comments

Comments
 (0)