@@ -83,6 +83,7 @@ KNOWN_SETTINGS=(
83
83
xctest-build-type " Debug" " the build variant for xctest"
84
84
swiftpm-build-type " Debug" " the build variant for swiftpm"
85
85
swiftsyntax-build-type " Debug" " the build variant for swiftSyntax"
86
+ skstresstester-build-type " Debug" " the build variant for the SourceKit stress tester"
86
87
llbuild-enable-assertions " 1" " enable assertions in llbuild"
87
88
enable-asan " " " enable Address Sanitizer"
88
89
enable-ubsan " " " enable Undefined Behavior Sanitizer"
@@ -124,6 +125,7 @@ KNOWN_SETTINGS=(
124
125
skip-build-llbuild " " " set to skip building llbuild"
125
126
skip-build-swiftpm " " " set to skip building swiftpm"
126
127
skip-build-swiftsyntax " " " set to skip building swiftSyntax"
128
+ skip-build-skstresstester " " " set to skip building the SourceKit stress tester"
127
129
skip-build-xctest " " " set to skip building xctest"
128
130
skip-build-foundation " " " set to skip building foundation"
129
131
skip-build-libdispatch " " " set to skip building libdispatch"
@@ -137,6 +139,7 @@ KNOWN_SETTINGS=(
137
139
skip-test-llbuild " " " set to skip testing llbuild"
138
140
skip-test-swiftpm " " " set to skip testing swiftpm"
139
141
skip-test-swiftsyntax " " " set to skip testing swiftSyntax"
142
+ skip-test-skstresstester " " " set to skip testing the SourceKit stress tester"
140
143
skip-test-xctest " " " set to skip testing xctest"
141
144
skip-test-foundation " " " set to skip testing foundation"
142
145
skip-test-libdispatch " " " set to skip testing libdispatch"
@@ -193,6 +196,7 @@ KNOWN_SETTINGS=(
193
196
install-swiftpm " " " whether to install swiftpm"
194
197
install-swiftsyntax " " " whether to install swiftsyntax"
195
198
skip-install-swiftsyntax-module " " " set to skip installing swiftsyntax modules"
199
+ install-skstresstester " " " whether to install the SourceKit stress tester"
196
200
install-xctest " " " whether to install xctest"
197
201
install-foundation " " " whether to install foundation"
198
202
install-libdispatch " " " whether to install libdispatch"
@@ -1171,6 +1175,7 @@ LLDB_SOURCE_DIR="${WORKSPACE}/lldb"
1171
1175
LLBUILD_SOURCE_DIR=" ${WORKSPACE} /llbuild"
1172
1176
SWIFTPM_SOURCE_DIR=" ${WORKSPACE} /swiftpm"
1173
1177
SWIFTSYNTAX_SOURCE_DIR=" ${WORKSPACE} /swift-syntax"
1178
+ SKSTRESSTESTER_SOURCE_DIR=" ${WORKSPACE} /swift-stress-tester/SourceKitStressTester"
1174
1179
XCTEST_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-xctest"
1175
1180
FOUNDATION_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-foundation"
1176
1181
LIBDISPATCH_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-libdispatch"
@@ -1211,8 +1216,9 @@ PRODUCTS=("${PRODUCTS[@]}" swift)
1211
1216
if [[ ! " ${SKIP_BUILD_LLDB} " ]] ; then
1212
1217
PRODUCTS=(" ${PRODUCTS[@]} " lldb)
1213
1218
fi
1214
- # LLBuild, SwiftPM, SwiftSyntax and XCTest are dependent on Foundation, so Foundation must be
1215
- # added to the list of build products first.
1219
+ # LLBuild, SwiftPM, SwiftSyntax, the SourceKit stress tester and XCTest are
1220
+ # dependent on Foundation, so Foundation must be added to the list of build
1221
+ # products first.
1216
1222
if [[ ! " ${SKIP_BUILD_LIBDISPATCH} " ]] ; then
1217
1223
PRODUCTS=(" ${PRODUCTS[@]} " libdispatch)
1218
1224
fi
@@ -1225,19 +1231,24 @@ fi
1225
1231
if [[ ! " ${SKIP_BUILD_PLAYGROUNDSUPPORT} " ]] ; then
1226
1232
PRODUCTS=(" ${PRODUCTS[@]} " playgroundsupport)
1227
1233
fi
1228
- # SwiftPM and SwiftSyntax are dependent on XCTest, so XCTest must be added to the list of
1229
- # build products first.
1234
+ # SwiftPM, SwiftSyntax and the SourceKit stress tester are dependent on XCTest,
1235
+ # so XCTest must be added to the list of build products first.
1230
1236
if [[ ! " ${SKIP_BUILD_XCTEST} " ]] ; then
1231
1237
PRODUCTS=(" ${PRODUCTS[@]} " xctest)
1232
1238
fi
1233
- # SwiftSyntax is dependent on SwiftPM, so SwiftPM must be added to the list of
1234
- # build products first.
1239
+ # SwiftSyntax and the SourceKit stress tester are dependent on SwiftPM, so
1240
+ # SwiftPM must be added to the list of build products first.
1235
1241
if [[ ! " ${SKIP_BUILD_SWIFTPM} " ]] ; then
1236
1242
PRODUCTS=(" ${PRODUCTS[@]} " swiftpm)
1237
1243
fi
1244
+ # The SourceKit stress tester is dependent on SwiftSyntax, so it must be added
1245
+ # to the list of build products first.
1238
1246
if [[ ! " ${SKIP_BUILD_SWIFTSYNTAX} " ]] ; then
1239
1247
PRODUCTS=(" ${PRODUCTS[@]} " swiftsyntax)
1240
1248
fi
1249
+ if [[ ! " ${SKIP_BUILD_SKSTRESSTESTER} " ]] ; then
1250
+ PRODUCTS=(" ${PRODUCTS[@]} " skstresstester)
1251
+ fi
1241
1252
1242
1253
# Checks if a given product is enabled (i.e. part of $PRODUCTS array)
1243
1254
function contains_product() {
@@ -1548,6 +1559,9 @@ function build_directory_bin() {
1548
1559
swiftsyntax)
1549
1560
echo " ${root} /${SWIFTSYNTAX_BUILD_TYPE} /bin"
1550
1561
;;
1562
+ skstresstester)
1563
+ echo " ${root} /${SKSTRESSTESTER_BUILD_TYPE} /bin"
1564
+ ;;
1551
1565
xctest)
1552
1566
echo " ${root} /${XCTEST_BUILD_TYPE} /bin"
1553
1567
;;
@@ -1687,6 +1701,9 @@ function cmake_config_opt() {
1687
1701
swiftsyntax)
1688
1702
echo " --config ${SWIFTSYNTAX_BUILD_TYPE} "
1689
1703
;;
1704
+ skstresstester)
1705
+ echo " --config ${SKSTRESSTESTER_BUILD_TYPE} "
1706
+ ;;
1690
1707
xctest)
1691
1708
echo " --config ${XCTEST_BUILD_TYPE} "
1692
1709
;;
@@ -1796,6 +1813,36 @@ function set_swiftsyntax_build_command() {
1796
1813
--filecheck-exec=" $( build_directory_bin ${LOCAL_HOST} llvm) /FileCheck" )
1797
1814
}
1798
1815
1816
+ function set_skstresstester_build_command() {
1817
+ if [ " ${SKIP_BUILD_SWIFTSYNTAX} " ]; then
1818
+ echo " Error: Cannot build the SourceKit stress tester without SwiftSyntax."
1819
+ exit 1
1820
+ fi
1821
+
1822
+ local swiftsyntax_config=" debug"
1823
+ if [[ $( is_cmake_release_build_type " ${SWIFTSYNTAX_BUILD_TYPE} " ) ]] ; then
1824
+ swiftsyntax_config=" release"
1825
+ fi
1826
+ local config=" debug"
1827
+ if [[ $( is_cmake_release_build_type " ${SKSTRESSTESTER_BUILD_TYPE} " ) ]] ; then
1828
+ config=" release"
1829
+ fi
1830
+
1831
+ skstresstester_build_command=(" ${SKSTRESSTESTER_SOURCE_DIR} /Utilities/build-script-helper.py" )
1832
+ if [[ " ${VERBOSE_BUILD} " ]] ; then
1833
+ skstresstester_build_command+=(-v)
1834
+ fi
1835
+
1836
+ skstresstester_build_command+=(
1837
+ --build-dir=" ${build_dir} "
1838
+ --swiftc-exec=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
1839
+ --swift-build-exec=" ${SWIFT_BUILD} "
1840
+ --swift-test-exec=" ${SWIFT_TEST} "
1841
+ --sourcekitd-dir=" $( build_directory ${host} swift) /lib"
1842
+ --swiftsyntax-dir=" $( build_directory ${host} swiftsyntax) /${swiftsyntax_config} "
1843
+ --config=" ${config} " )
1844
+ }
1845
+
1799
1846
# Construct the appropriate options to pass to an Xcode
1800
1847
# build of any LLDB target.
1801
1848
function set_lldb_xcodebuild_options() {
@@ -2474,6 +2521,16 @@ for host in "${ALL_HOSTS[@]}"; do
2474
2521
set_swiftsyntax_build_command
2475
2522
call " ${swiftsyntax_build_command[@]} "
2476
2523
2524
+ continue
2525
+ ;;
2526
+ skstresstester)
2527
+ if [[ " $( uname -s) " != " Darwin" ]]; then
2528
+ echo " error: unable to build swift-stress-tester on this platform"
2529
+ continue
2530
+ fi
2531
+ set_skstresstester_build_command
2532
+ call " ${skstresstester_build_command[@]} "
2533
+
2477
2534
continue
2478
2535
;;
2479
2536
xctest)
@@ -3088,6 +3145,14 @@ for host in "${ALL_HOSTS[@]}"; do
3088
3145
# As swiftSyntax tests itself, we break early here.
3089
3146
continue
3090
3147
;;
3148
+ skstresstester)
3149
+ if [[ " ${SKIP_TEST_SKSTRESSTESTER} " ]]; then
3150
+ continue
3151
+ fi
3152
+ echo " --- Running tests for ${product} ---"
3153
+ call " ${skstresstester_build_command[@]} " test
3154
+ continue
3155
+ ;;
3091
3156
xctest)
3092
3157
if [[ " ${SKIP_TEST_XCTEST} " ]]; then
3093
3158
continue
@@ -3401,6 +3466,23 @@ for host in "${ALL_HOSTS[@]}"; do
3401
3466
call " ${swiftsyntax_build_command[@]} " --dylib-dir=" ${DYLIB_DIR} " --install
3402
3467
fi
3403
3468
3469
+ continue
3470
+ ;;
3471
+ skstresstester)
3472
+ if [[ -z " ${INSTALL_SKSTRESSTESTER} " ]] ; then
3473
+ continue
3474
+ fi
3475
+ if [[ -z " ${INSTALL_DESTDIR} " ]] ; then
3476
+ echo " --install-destdir is required to install products."
3477
+ exit 1
3478
+ fi
3479
+ if [[ -z " ${INSTALL_SWIFTSYNTAX} " ]] ; then
3480
+ echo " --install-swiftsyntax is required to install the SourceKit stress tester"
3481
+ exit 1
3482
+ fi
3483
+
3484
+ echo " --- Installing ${product} ---"
3485
+ call " ${skstresstester_build_command[@]} " --prefix=" ${host_install_destdir}${host_install_prefix} " install
3404
3486
continue
3405
3487
;;
3406
3488
xctest)
0 commit comments