@@ -85,6 +85,7 @@ KNOWN_SETTINGS=(
85
85
lldb-build-type " Debug" " the CMake build variant for LLDB"
86
86
llbuild-build-type " Debug" " the CMake build variant for llbuild"
87
87
foundation-build-type " Debug" " the build variant for Foundation"
88
+ xctest-build-type " Debug" " the build variant for xctest"
88
89
llbuild-enable-assertions " 1" " enable assertions in llbuild"
89
90
enable-asan " " " enable Address Sanitizer"
90
91
enable-ubsan " " " enable Undefined Behavior Sanitizer"
@@ -2104,13 +2105,19 @@ for host in "${ALL_HOSTS[@]}"; do
2104
2105
copy_swift_stdlib_tool_substitute " $( build_directory_bin ${host} swift) /swift-stdlib-tool"
2105
2106
fi
2106
2107
2107
- # FIXME: Use XCTEST_BUILD_TYPE (which is never properly
2108
- # set) to build either --debug or --release.
2108
+ # Use XCTEST_BUILD_TYPE to build either --debug or --release.
2109
+ if [[ " ${XCTEST_BUILD_TYPE} " == " Debug" ]] ; then
2110
+ XCTEST_BUILD_ARGS=" --debug"
2111
+ else
2112
+ XCTEST_BUILD_ARGS=" --release"
2113
+ fi
2114
+
2109
2115
call " ${XCTEST_SOURCE_DIR} " /build_script.py \
2110
2116
--swiftc=" ${SWIFTC_BIN} " \
2111
2117
--build-dir=" ${XCTEST_BUILD_DIR} " \
2112
2118
--foundation-build-dir=" ${FOUNDATION_BUILD_DIR} /Foundation" \
2113
- $LIBDISPATCH_BUILD_ARGS
2119
+ $LIBDISPATCH_BUILD_ARGS \
2120
+ $XCTEST_BUILD_ARGS
2114
2121
2115
2122
# XCTest builds itself and doesn't rely on cmake
2116
2123
continue
@@ -2400,6 +2407,14 @@ for host in "${ALL_HOSTS[@]}"; do
2400
2407
LIBDISPATCH_BUILD_DIR=" $( build_directory ${host} libdispatch) "
2401
2408
LIBDISPATCH_BUILD_ARGS=" --libdispatch-src-dir=${LIBDISPATCH_SOURCE_DIR} --libdispatch-build-dir=${LIBDISPATCH_BUILD_DIR} "
2402
2409
fi
2410
+
2411
+ # Use XCTEST_BUILD_TYPE to build either --debug or --release.
2412
+ if [[ " ${XCTEST_BUILD_TYPE} " == " Debug" ]] ; then
2413
+ XCTEST_BUILD_ARGS=" --debug"
2414
+ else
2415
+ XCTEST_BUILD_ARGS=" --release"
2416
+ fi
2417
+
2403
2418
echo " --- Running tests for ${product} ---"
2404
2419
SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
2405
2420
FOUNDATION_BUILD_DIR=$( build_directory ${host} foundation)
@@ -2408,6 +2423,7 @@ for host in "${ALL_HOSTS[@]}"; do
2408
2423
--swiftc=" ${SWIFTC_BIN} " \
2409
2424
--foundation-build-dir=" ${FOUNDATION_BUILD_DIR} /Foundation" \
2410
2425
${LIBDISPATCH_BUILD_ARGS} \
2426
+ $XCTEST_BUILD_ARGS \
2411
2427
" ${XCTEST_BUILD_DIR} "
2412
2428
echo " --- Finished tests for ${product} ---"
2413
2429
continue
0 commit comments