Skip to content

Commit 4aa00ac

Browse files
gribozavrMax Moiseev
authored andcommitted
stdlib: share the Unicode dataset across different test files
1 parent f659250 commit 4aa00ac

File tree

7 files changed

+818
-706
lines changed

7 files changed

+818
-706
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,8 @@ function(add_swift_library name)
15131513
add_dependencies("swift-stdlib${VARIANT_SUFFIX}"
15141514
${lipo_target}
15151515
${lipo_target_static})
1516-
if(NOT "${name}" STREQUAL "swiftStdlibCollectionUnittest")
1516+
if((NOT "${name}" STREQUAL "swiftStdlibCollectionUnittest") AND
1517+
(NOT "${name}" STREQUAL "swiftStdlibUnicodeUnittest"))
15171518
add_dependencies("swift-test-stdlib${VARIANT_SUFFIX}"
15181519
${lipo_target}
15191520
${lipo_target_static})

stdlib/private/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if(SWIFT_BUILD_SDK_OVERLAY)
66
# SwiftPrivatePthreadExtras makes use of Darwin/Glibc, which is part of the
77
# SDK overlay. It can't be built separately from the SDK overlay.
88
add_subdirectory(StdlibUnittest)
9+
add_subdirectory(StdlibUnicodeUnittest)
910
add_subdirectory(StdlibCollectionUnittest)
1011
add_subdirectory(SwiftPrivateLibcExtras)
1112
add_subdirectory(SwiftPrivatePthreadExtras)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
set(swift_stdlib_unittest_compile_flags)
2+
if(SWIFT_SERIALIZE_STDLIB_UNITTEST)
3+
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-all")
4+
endif()
5+
6+
# TODO: support this on non-POSIX platforms. It cannot be currently as it
7+
# depends on pthreads.
8+
add_swift_library(swiftStdlibUnicodeUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
9+
# This file should be listed the first. Module name is inferred from the
10+
# filename.
11+
StdlibUnicodeUnittest.swift
12+
13+
SWIFT_MODULE_DEPENDS StdlibUnittest
14+
SWIFT_COMPILE_FLAGS ${swift_stdlib_unittest_compile_flags}
15+
TARGET_SDKS ALL_POSIX_PLATFORMS
16+
INSTALL_IN_COMPONENT stdlib-experimental)
17+

0 commit comments

Comments
 (0)