Skip to content

[build-script] Build & test XCTest (on OS X, too) #1316

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
Feb 24, 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
32 changes: 26 additions & 6 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -1746,11 +1746,17 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"
continue
;;
xctest)
SWIFTC_BIN="$(build_directory_bin ${deployment_target} swift)/swiftc"
SWIFT_BUILD_PATH="$(build_directory ${deployment_target} swift)"
set -x
"${XCTEST_SOURCE_DIR}"/build_script.py --swiftc="${SWIFTC_BIN}" --build-dir="${build_dir}" --swift-build-dir="${SWIFT_BUILD_PATH}" --arch="${SWIFT_HOST_VARIANT_ARCH}"
{ set +x; } 2>/dev/null
if [[ "$(uname -s)" == "Darwin" ]] ; then
set -x
xcodebuild -project "${XCTEST_SOURCE_DIR}"/XCTest.xcodeproj -scheme SwiftXCTest SKIP_INSTALL=NO DEPLOYMENT_LOCATION=YES DSTROOT="${build_dir}" INSTALL_PATH="/"
{ set +x; } 2>/dev/null
else
SWIFTC_BIN="$(build_directory_bin ${deployment_target} swift)/swiftc"
SWIFT_BUILD_PATH="$(build_directory ${deployment_target} swift)"
set -x
"${XCTEST_SOURCE_DIR}"/build_script.py --swiftc="${SWIFTC_BIN}" --build-dir="${build_dir}" --swift-build-dir="${SWIFT_BUILD_PATH}" --arch="${SWIFT_HOST_VARIANT_ARCH}"
{ set +x; } 2>/dev/null
fi

# XCTest builds itself and doesn't rely on cmake
continue
Expand Down Expand Up @@ -1991,7 +1997,21 @@ for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do
if [[ "${SKIP_TEST_XCTEST}" ]]; then
continue
fi
# FIXME: We don't test xctest, yet...
echo "--- Running tests for ${product} ---"
if [[ "$(uname -s)" == "Darwin" ]] ; then
set -x
xcodebuild -project "${XCTEST_SOURCE_DIR}"/XCTest.xcodeproj -scheme SwiftXCTestFunctionalTests
{ set +x; } 2>/dev/null
else
SWIFTC_BIN="$(build_directory_bin ${deployment_target} swift)/swiftc"
SWIFT_BUILD_PATH="$(build_directory ${deployment_target} swift)"
set -x
# FIXME: This re-builds swift-corelibs-xctest. Instead, 'build_script.py' should take
# a top-level 'test' command that only tests an already built XCTest.
"${XCTEST_SOURCE_DIR}"/build_script.py --swiftc="${SWIFTC_BIN}" --build-dir="${build_dir}" --swift-build-dir="${SWIFT_BUILD_PATH}" --arch="${SWIFT_HOST_VARIANT_ARCH}" --test
{ set +x; } 2>/dev/null
fi
echo "--- Finished tests for ${product} ---"
continue
;;
foundation)
Expand Down