Skip to content

Commit 8456dac

Browse files
authored
Merge pull request #3226 from jamala/xctest-propagate-build-type
2 parents 4c20826 + bbd3f94 commit 8456dac

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

utils/build-script

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,7 @@ class BuildScriptInvocation(object):
594594
"--swift-stdlib-build-type", args.swift_stdlib_build_variant,
595595
"--lldb-build-type", args.lldb_build_variant,
596596
"--foundation-build-type", args.foundation_build_variant,
597+
"--xctest-build-type", args.build_variant,
597598
"--llvm-enable-assertions", str(args.llvm_assertions).lower(),
598599
"--swift-enable-assertions", str(args.swift_assertions).lower(),
599600
"--swift-stdlib-enable-assertions", str(

utils/build-script-impl

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ KNOWN_SETTINGS=(
8585
lldb-build-type "Debug" "the CMake build variant for LLDB"
8686
llbuild-build-type "Debug" "the CMake build variant for llbuild"
8787
foundation-build-type "Debug" "the build variant for Foundation"
88+
xctest-build-type "Debug" "the build variant for xctest"
8889
llbuild-enable-assertions "1" "enable assertions in llbuild"
8990
enable-asan "" "enable Address Sanitizer"
9091
enable-ubsan "" "enable Undefined Behavior Sanitizer"
@@ -2104,13 +2105,19 @@ for host in "${ALL_HOSTS[@]}"; do
21042105
copy_swift_stdlib_tool_substitute "$(build_directory_bin ${host} swift)/swift-stdlib-tool"
21052106
fi
21062107

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+
21092115
call "${XCTEST_SOURCE_DIR}"/build_script.py \
21102116
--swiftc="${SWIFTC_BIN}" \
21112117
--build-dir="${XCTEST_BUILD_DIR}" \
21122118
--foundation-build-dir="${FOUNDATION_BUILD_DIR}/Foundation" \
2113-
$LIBDISPATCH_BUILD_ARGS
2119+
$LIBDISPATCH_BUILD_ARGS \
2120+
$XCTEST_BUILD_ARGS
21142121

21152122
# XCTest builds itself and doesn't rely on cmake
21162123
continue
@@ -2400,6 +2407,14 @@ for host in "${ALL_HOSTS[@]}"; do
24002407
LIBDISPATCH_BUILD_DIR="$(build_directory ${host} libdispatch)"
24012408
LIBDISPATCH_BUILD_ARGS="--libdispatch-src-dir=${LIBDISPATCH_SOURCE_DIR} --libdispatch-build-dir=${LIBDISPATCH_BUILD_DIR}"
24022409
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+
24032418
echo "--- Running tests for ${product} ---"
24042419
SWIFTC_BIN="$(build_directory_bin ${LOCAL_HOST} swift)/swiftc"
24052420
FOUNDATION_BUILD_DIR=$(build_directory ${host} foundation)
@@ -2408,6 +2423,7 @@ for host in "${ALL_HOSTS[@]}"; do
24082423
--swiftc="${SWIFTC_BIN}" \
24092424
--foundation-build-dir="${FOUNDATION_BUILD_DIR}/Foundation" \
24102425
${LIBDISPATCH_BUILD_ARGS} \
2426+
$XCTEST_BUILD_ARGS \
24112427
"${XCTEST_BUILD_DIR}"
24122428
echo "--- Finished tests for ${product} ---"
24132429
continue

0 commit comments

Comments
 (0)