947
947
if [[ ! " ${SKIP_BUILD_SWIFTPM} " ]] ; then
948
948
PRODUCTS=(" ${PRODUCTS[@]} " swiftpm)
949
949
fi
950
- if [[ ! " ${SKIP_BUILD_XCTEST} " ]] ; then
951
- PRODUCTS=(" ${PRODUCTS[@]} " xctest)
952
- fi
953
950
if [[ ! " ${SKIP_BUILD_LIBDISPATCH} " ]] ; then
954
951
PRODUCTS=(" ${PRODUCTS[@]} " libdispatch)
955
952
fi
953
+ # XCTest has a dependency on Foundation, so Foundation must be added to the
954
+ # list of build products first.
956
955
if [[ ! " ${SKIP_BUILD_FOUNDATION} " ]] ; then
957
956
PRODUCTS=(" ${PRODUCTS[@]} " foundation)
958
957
fi
958
+ if [[ ! " ${SKIP_BUILD_XCTEST} " ]] ; then
959
+ PRODUCTS=(" ${PRODUCTS[@]} " xctest)
960
+ fi
959
961
960
962
SWIFT_STDLIB_TARGETS=()
961
963
SWIFT_BENCHMARK_TARGETS=()
@@ -1343,7 +1345,8 @@ function set_swiftpm_bootstrap_command() {
1343
1345
1344
1346
SWIFTC_BIN=" $( build_directory_bin ${deployment_target} swift) /swiftc"
1345
1347
LLBUILD_BIN=" $( build_directory_bin ${deployment_target} llbuild) /swift-build-tool"
1346
- if [[ ! " ${SKIP_BUILD_XCTEST} " ]] ; then
1348
+ if [[ ! " ${SKIP_BUILD_FOUNDATION} " && ! " ${SKIP_BUILD_XCTEST} " ]] ; then
1349
+ FOUNDATION_BUILD_DIR=$( build_directory ${deployment_target} foundation)
1347
1350
XCTEST_BUILD_DIR=$( build_directory ${deployment_target} xctest)
1348
1351
fi
1349
1352
if [ ! -e " ${LLBUILD_BIN} " ]; then
@@ -1357,8 +1360,8 @@ function set_swiftpm_bootstrap_command() {
1357
1360
swiftpm_bootstrap_command=(" ${swiftpm_bootstrap_command[@]} " --swiftc=" ${SWIFTC_BIN} " )
1358
1361
swiftpm_bootstrap_command=(" ${swiftpm_bootstrap_command[@]} " --sbt=" ${LLBUILD_BIN} " )
1359
1362
swiftpm_bootstrap_command=(" ${swiftpm_bootstrap_command[@]} " --build=" ${build_dir} " )
1360
- if [[ ! " ${SKIP_BUILD_XCTEST} " ]] ; then
1361
- swiftpm_bootstrap_command=(" ${swiftpm_bootstrap_command[@]} " --xctest=" ${XCTEST_BUILD_DIR} " )
1363
+ if [[ ! " ${SKIP_BUILD_FOUNDATION} " && ! " ${ SKIP_BUILD_XCTEST}" ]] ; then
1364
+ swiftpm_bootstrap_command=(" ${swiftpm_bootstrap_command[@]} " --foundation= " ${FOUNDATION_BUILD_DIR} /Foundation " -- xctest=" ${XCTEST_BUILD_DIR} " )
1362
1365
fi
1363
1366
}
1364
1367
@@ -1859,7 +1862,7 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"
1859
1862
if [[ " $( uname -s) " == " Darwin" ]] ; then
1860
1863
set -x
1861
1864
xcodebuild \
1862
- -project " ${XCTEST_SOURCE_DIR} " /XCTest.xcodeproj \
1865
+ -workspace " ${XCTEST_SOURCE_DIR} " /XCTest.xcworkspace \
1863
1866
-scheme SwiftXCTest \
1864
1867
SKIP_INSTALL=NO \
1865
1868
DEPLOYMENT_LOCATION=YES \
@@ -1868,20 +1871,24 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"
1868
1871
{ set +x; } 2> /dev/null
1869
1872
else
1870
1873
SWIFTC_BIN=" $( build_directory_bin ${deployment_target} swift) /swiftc"
1874
+ FOUNDATION_BUILD_DIR=$( build_directory ${deployment_target} foundation)
1871
1875
set -x
1872
1876
# FIXME: Use XCTEST_BUILD_TYPE (which is never properly
1873
1877
# set) to build either --debug or --release.
1874
1878
" ${XCTEST_SOURCE_DIR} " /build_script.py \
1875
1879
--swiftc=" ${SWIFTC_BIN} " \
1876
- --build-dir=" ${XCTEST_BUILD_DIR} "
1880
+ --build-dir=" ${XCTEST_BUILD_DIR} " \
1881
+ --foundation-build-dir=" ${FOUNDATION_BUILD_DIR} /Foundation"
1877
1882
{ set +x; } 2> /dev/null
1878
1883
fi
1879
1884
1880
1885
# XCTest builds itself and doesn't rely on cmake
1881
1886
continue
1882
1887
;;
1883
1888
foundation)
1884
- # the configuration script requires knowing about XCTest's location for building and running the tests
1889
+ # The configuration script requires knowing about XCTest's
1890
+ # location for building and running the tests. Note that XCTest
1891
+ # is not yet built at this point.
1885
1892
XCTEST_BUILD_DIR=$( build_directory ${deployment_target} xctest)
1886
1893
SWIFTC_BIN=" $( build_directory_bin ${deployment_target} swift) /swiftc"
1887
1894
SWIFT_BIN=" $( build_directory_bin ${deployment_target} swift) /swift"
@@ -2122,15 +2129,17 @@ for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do
2122
2129
if [[ " $( uname -s) " == " Darwin" ]] ; then
2123
2130
set -x
2124
2131
xcodebuild \
2125
- -project " ${XCTEST_SOURCE_DIR} " /XCTest.xcodeproj \
2132
+ -workspace " ${XCTEST_SOURCE_DIR} " /XCTest.xcworkspace \
2126
2133
-scheme SwiftXCTestFunctionalTests
2127
2134
{ set +x; } 2> /dev/null
2128
2135
else
2129
2136
SWIFTC_BIN=" $( build_directory_bin ${deployment_target} swift) /swiftc"
2137
+ FOUNDATION_BUILD_DIR=$( build_directory ${deployment_target} foundation)
2130
2138
XCTEST_BUILD_DIR=$( build_directory ${deployment_target} xctest)
2131
2139
set -x
2132
2140
" ${XCTEST_SOURCE_DIR} " /build_script.py test \
2133
2141
--swiftc=" ${SWIFTC_BIN} " \
2142
+ --foundation-build-dir=" ${FOUNDATION_BUILD_DIR} /Foundation" \
2134
2143
" ${XCTEST_BUILD_DIR} "
2135
2144
{ set +x; } 2> /dev/null
2136
2145
fi
0 commit comments