Skip to content

[build-script-impl] Call the XCTest build_script.py on all platforms #2259

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 1 commit into from
Apr 29, 2016
Merged
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
58 changes: 18 additions & 40 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -1934,35 +1934,25 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"
xctest)
SWIFTC_BIN="$(build_directory_bin ${deployment_target} swift)/swiftc"
XCTEST_BUILD_DIR=$(build_directory ${deployment_target} xctest)
FOUNDATION_BUILD_DIR=$(build_directory ${deployment_target} foundation)
if [[ "$(uname -s)" == "Darwin" ]] ; then
# xcodebuild requires swift-stdlib-tool to build a Swift
# framework. This is normally present when building XCTest
# via a packaged .xctoolchain, but here we are using the
# swiftc that was just built--no toolchain exists yet. As a
# result, we must copy swift-stdlib-tool ourselves.
copy_swift_stdlib_tool_substitute "$(build_directory_bin ${deployment_target} swift)/swift-stdlib-tool"

set -x
xcodebuild \
-workspace "${XCTEST_SOURCE_DIR}"/XCTest.xcworkspace \
-scheme SwiftXCTest \
SWIFT_EXEC="${SWIFTC_BIN}" \
SWIFT_LINK_OBJC_RUNTIME=YES \
SYMROOT="${XCTEST_BUILD_DIR}" \
OBJROOT="${XCTEST_BUILD_DIR}"
{ set +x; } 2>/dev/null
else
FOUNDATION_BUILD_DIR=$(build_directory ${deployment_target} foundation)
set -x
# FIXME: Use XCTEST_BUILD_TYPE (which is never properly
# set) to build either --debug or --release.
"${XCTEST_SOURCE_DIR}"/build_script.py \
--swiftc="${SWIFTC_BIN}" \
--build-dir="${XCTEST_BUILD_DIR}" \
--foundation-build-dir="${FOUNDATION_BUILD_DIR}/Foundation"
{ set +x; } 2>/dev/null
fi

set -x
# FIXME: Use XCTEST_BUILD_TYPE (which is never properly
# set) to build either --debug or --release.
"${XCTEST_SOURCE_DIR}"/build_script.py \
--swiftc="${SWIFTC_BIN}" \
--build-dir="${XCTEST_BUILD_DIR}" \
--foundation-build-dir="${FOUNDATION_BUILD_DIR}/Foundation"
{ set +x; } 2>/dev/null

# XCTest builds itself and doesn't rely on cmake
continue
;;
Expand Down Expand Up @@ -2243,26 +2233,14 @@ for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do
fi
echo "--- Running tests for ${product} ---"
SWIFTC_BIN="$(build_directory_bin ${deployment_target} swift)/swiftc"
if [[ "$(uname -s)" == "Darwin" ]] ; then
set -x
xcodebuild \
-workspace "${XCTEST_SOURCE_DIR}"/XCTest.xcworkspace \
-scheme SwiftXCTestFunctionalTests \
SWIFT_EXEC="${SWIFTC_BIN}" \
SWIFT_LINK_OBJC_RUNTIME=YES \
SYMROOT="${XCTEST_BUILD_DIR}" \
OBJROOT="${XCTEST_BUILD_DIR}"
{ set +x; } 2>/dev/null
else
FOUNDATION_BUILD_DIR=$(build_directory ${deployment_target} foundation)
XCTEST_BUILD_DIR=$(build_directory ${deployment_target} xctest)
set -x
"${XCTEST_SOURCE_DIR}"/build_script.py test \
--swiftc="${SWIFTC_BIN}" \
--foundation-build-dir="${FOUNDATION_BUILD_DIR}/Foundation" \
"${XCTEST_BUILD_DIR}"
{ set +x; } 2>/dev/null
fi
FOUNDATION_BUILD_DIR=$(build_directory ${deployment_target} foundation)
XCTEST_BUILD_DIR=$(build_directory ${deployment_target} xctest)
set -x
"${XCTEST_SOURCE_DIR}"/build_script.py test \
--swiftc="${SWIFTC_BIN}" \
--foundation-build-dir="${FOUNDATION_BUILD_DIR}/Foundation" \
"${XCTEST_BUILD_DIR}"
{ set +x; } 2>/dev/null
echo "--- Finished tests for ${product} ---"
continue
;;
Expand Down