Skip to content

Build-script: propagate the build type to the xctest build script #3226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions utils/build-script
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ class BuildScriptInvocation(object):
"--swift-stdlib-build-type", args.swift_stdlib_build_variant,
"--lldb-build-type", args.lldb_build_variant,
"--foundation-build-type", args.foundation_build_variant,
"--xctest-build-type", args.build_variant,
"--llvm-enable-assertions", str(args.llvm_assertions).lower(),
"--swift-enable-assertions", str(args.swift_assertions).lower(),
"--swift-stdlib-enable-assertions", str(
Expand Down
22 changes: 19 additions & 3 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ KNOWN_SETTINGS=(
lldb-build-type "Debug" "the CMake build variant for LLDB"
llbuild-build-type "Debug" "the CMake build variant for llbuild"
foundation-build-type "Debug" "the build variant for Foundation"
xctest-build-type "Debug" "the build variant for xctest"
llbuild-enable-assertions "1" "enable assertions in llbuild"
enable-asan "" "enable Address Sanitizer"
enable-ubsan "" "enable Undefined Behavior Sanitizer"
Expand Down Expand Up @@ -2104,13 +2105,19 @@ for host in "${ALL_HOSTS[@]}"; do
copy_swift_stdlib_tool_substitute "$(build_directory_bin ${host} swift)/swift-stdlib-tool"
fi

# FIXME: Use XCTEST_BUILD_TYPE (which is never properly
# set) to build either --debug or --release.
# Use XCTEST_BUILD_TYPE to build either --debug or --release.
if [[ "${XCTEST_BUILD_TYPE}" == "Debug" ]] ; then
XCTEST_BUILD_ARGS="--debug"
else
XCTEST_BUILD_ARGS="--release"
fi

call "${XCTEST_SOURCE_DIR}"/build_script.py \
--swiftc="${SWIFTC_BIN}" \
--build-dir="${XCTEST_BUILD_DIR}" \
--foundation-build-dir="${FOUNDATION_BUILD_DIR}/Foundation" \
$LIBDISPATCH_BUILD_ARGS
$LIBDISPATCH_BUILD_ARGS \
$XCTEST_BUILD_ARGS

# XCTest builds itself and doesn't rely on cmake
continue
Expand Down Expand Up @@ -2400,6 +2407,14 @@ for host in "${ALL_HOSTS[@]}"; do
LIBDISPATCH_BUILD_DIR="$(build_directory ${host} libdispatch)"
LIBDISPATCH_BUILD_ARGS="--libdispatch-src-dir=${LIBDISPATCH_SOURCE_DIR} --libdispatch-build-dir=${LIBDISPATCH_BUILD_DIR}"
fi

# Use XCTEST_BUILD_TYPE to build either --debug or --release.
if [[ "${XCTEST_BUILD_TYPE}" == "Debug" ]] ; then
XCTEST_BUILD_ARGS="--debug"
else
XCTEST_BUILD_ARGS="--release"
fi

echo "--- Running tests for ${product} ---"
SWIFTC_BIN="$(build_directory_bin ${LOCAL_HOST} swift)/swiftc"
FOUNDATION_BUILD_DIR=$(build_directory ${host} foundation)
Expand All @@ -2408,6 +2423,7 @@ for host in "${ALL_HOSTS[@]}"; do
--swiftc="${SWIFTC_BIN}" \
--foundation-build-dir="${FOUNDATION_BUILD_DIR}/Foundation" \
${LIBDISPATCH_BUILD_ARGS} \
$XCTEST_BUILD_ARGS \
"${XCTEST_BUILD_DIR}"
echo "--- Finished tests for ${product} ---"
continue
Expand Down