@@ -632,6 +632,10 @@ details of the setups of other systems or automated environments.""")
632
632
"-B" , "--benchmark" ,
633
633
help = "run the Swift Benchmark Suite after building" ,
634
634
action = "store_true" )
635
+ run_tests_group .add_argument (
636
+ "--skip-test-osx" ,
637
+ help = "skip testing Swift stdlibs for Mac OS X" ,
638
+ action = "store_true" )
635
639
run_tests_group .add_argument (
636
640
"--skip-test-linux" ,
637
641
help = "skip testing Swift stdlibs for Linux" ,
@@ -668,6 +672,10 @@ details of the setups of other systems or automated environments.""")
668
672
"--skip-build-cygwin" ,
669
673
help = "skip building Swift stdlibs for Cygwin" ,
670
674
action = "store_true" )
675
+ run_build_group .add_argument (
676
+ "--skip-build-osx" ,
677
+ help = "skip building Swift stdlibs for MacOSX" ,
678
+ action = "store_true" )
671
679
672
680
run_build_group .add_argument (
673
681
"--skip-build-benchmarks" ,
@@ -980,10 +988,10 @@ details of the setups of other systems or automated environments.""")
980
988
if args .build_variant is None :
981
989
args .build_variant = "Debug"
982
990
991
+ # Propagate the default build variant.
983
992
if args .cmark_build_variant is None :
984
993
args .cmark_build_variant = args .build_variant
985
994
986
- # Propagate the default build variant.
987
995
if args .llvm_build_variant is None :
988
996
args .llvm_build_variant = args .build_variant
989
997
@@ -1023,6 +1031,27 @@ details of the setups of other systems or automated environments.""")
1023
1031
if args .cmake_generator is None :
1024
1032
args .cmake_generator = "Ninja"
1025
1033
1034
+ # SwiftPM and XCTest have a dependency on Foundation.
1035
+ # On OS X, Foundation is built automatically using xcodebuild.
1036
+ # On Linux, we must ensure that it is built manually.
1037
+ if ((args .build_swiftpm or args .build_xctest ) and
1038
+ platform .system () != "Darwin" ):
1039
+ args .build_foundation = True
1040
+
1041
+ # Propagate global --skip-build
1042
+ if args .skip_build :
1043
+ args .skip_build_linux = True
1044
+ args .skip_build_freebsd = True
1045
+ args .skip_build_cygwin = True
1046
+ args .skip_build_osx = True
1047
+ args .skip_build_benchmarks = True
1048
+ args .build_lldb = False
1049
+ args .build_llbuild = False
1050
+ args .build_swiftpm = False
1051
+ args .build_xctest = False
1052
+ args .build_foundation = False
1053
+ args .build_libdispatch = False
1054
+
1026
1055
# --validation-test implies --test.
1027
1056
if args .validation_test :
1028
1057
args .test = True
@@ -1031,176 +1060,33 @@ details of the setups of other systems or automated environments.""")
1031
1060
if args .test_optimized :
1032
1061
args .test = True
1033
1062
1034
- # SwiftPM and XCTest have a dependency on Foundation.
1035
- # On OS X, Foundation is built automatically using xcodebuild.
1036
- # On Linux, we must ensure that it is built manually.
1037
- if (args .build_swiftpm or args .build_xctest ) and \
1038
- platform .system () != "Darwin" :
1039
- args .build_foundation = True
1063
+ # If none of tests specified skip swift stdlib test on all platforms
1064
+ if not args .test and not args .validation_test and not args .long_test :
1065
+ args .skip_test_linux = True
1066
+ args .skip_test_freebsd = True
1067
+ args .skip_test_cygwin = True
1068
+ args .skip_test_osx = True
1069
+ args .skip_test_ios = True
1070
+ args .skip_test_tvos = True
1071
+ args .skip_test_watchos = True
1040
1072
1041
1073
# --skip-test-ios is merely a shorthand for host and simulator tests.
1042
- if args .skip_test_ios :
1074
+ if args .skip_test_ios or not args . ios :
1043
1075
args .skip_test_ios_host = True
1044
1076
args .skip_test_ios_simulator = True
1045
1077
# --skip-test-tvos is merely a shorthand for host and simulator tests.
1046
- if args .skip_test_tvos :
1078
+ if args .skip_test_tvos or not args . tvos :
1047
1079
args .skip_test_tvos_host = True
1048
1080
args .skip_test_tvos_simulator = True
1049
1081
# --skip-test-watchos is merely a shorthand for host and simulator tests.
1050
- if args .skip_test_watchos :
1082
+ if args .skip_test_watchos or not args . watchos :
1051
1083
args .skip_test_watchos_host = True
1052
1084
args .skip_test_watchos_simulator = True
1053
1085
1054
- build_script_impl_inferred_args = []
1055
-
1056
- if not args .test and not args .validation_test and not args .long_test :
1057
- build_script_impl_inferred_args += [
1058
- "--skip-test-swift" ,
1059
- "--skip-test-linux" ,
1060
- "--skip-test-freebsd" ,
1061
- "--skip-test-cygwin" ,
1062
- "--skip-test-osx" ,
1063
- "--skip-test-ios-simulator" ,
1064
- "--skip-test-ios-host" ,
1065
- "--skip-test-tvos-simulator" ,
1066
- "--skip-test-tvos-host" ,
1067
- "--skip-test-watchos-simulator" ,
1068
- "--skip-test-watchos-host" ,
1069
- ]
1070
-
1071
- if not args .test :
1072
- build_script_impl_inferred_args += [
1073
- "--skip-test-cmark" ,
1074
- "--skip-test-lldb" ,
1075
- "--skip-test-llbuild" ,
1076
- "--skip-test-swiftpm" ,
1077
- "--skip-test-xctest" ,
1078
- "--skip-test-foundation" ,
1079
- "--skip-test-libdispatch" ,
1080
- ]
1081
-
1082
- if args .validation_test :
1083
- build_script_impl_inferred_args += [
1084
- "--validation-test"
1085
- ]
1086
-
1087
- if args .long_test :
1088
- build_script_impl_inferred_args += [
1089
- "--long-test"
1090
- ]
1091
-
1092
1086
if not args .host_test :
1093
- build_script_impl_inferred_args += [
1094
- "--skip-test-ios-host" ,
1095
- "--skip-test-tvos-host" ,
1096
- "--skip-test-watchos-host" ,
1097
- ]
1098
-
1099
- if not args .benchmark :
1100
- build_script_impl_inferred_args += [
1101
- "--skip-test-benchmarks"
1102
- ]
1103
-
1104
- if not args .test_optimized :
1105
- build_script_impl_inferred_args += [
1106
- "--skip-test-optimized"
1107
- ]
1108
-
1109
- if not args .ios :
1110
- build_script_impl_inferred_args += [
1111
- "--skip-build-ios" ,
1112
- "--skip-test-ios-simulator" ,
1113
- "--skip-test-ios-host" ,
1114
- ]
1115
-
1116
- if not args .tvos :
1117
- build_script_impl_inferred_args += [
1118
- "--skip-build-tvos" ,
1119
- "--skip-test-tvos-simulator" ,
1120
- "--skip-test-tvos-host" ,
1121
- ]
1122
-
1123
- if not args .watchos :
1124
- build_script_impl_inferred_args += [
1125
- "--skip-build-watchos" ,
1126
- "--skip-test-watchos-simulator" ,
1127
- "--skip-test-watchos-host" ,
1128
- ]
1129
-
1130
- if not args .android :
1131
- build_script_impl_inferred_args += [
1132
- "--skip-build-android" ,
1133
- ]
1134
-
1135
- if not args .build_lldb :
1136
- build_script_impl_inferred_args += [
1137
- "--skip-build-lldb"
1138
- ]
1139
-
1140
- if not args .build_llbuild :
1141
- build_script_impl_inferred_args += [
1142
- "--skip-build-llbuild"
1143
- ]
1144
-
1145
- if not args .build_swiftpm :
1146
- build_script_impl_inferred_args += [
1147
- "--skip-build-swiftpm"
1148
- ]
1149
-
1150
- if not args .build_xctest :
1151
- build_script_impl_inferred_args += [
1152
- "--skip-build-xctest"
1153
- ]
1154
-
1155
- if not args .build_foundation :
1156
- build_script_impl_inferred_args += [
1157
- "--skip-build-foundation"
1158
- ]
1159
-
1160
- if not args .build_libdispatch :
1161
- build_script_impl_inferred_args += [
1162
- "--skip-build-libdispatch"
1163
- ]
1164
-
1165
- if args .skip_build_benchmarks :
1166
- build_script_impl_inferred_args += [
1167
- "--skip-build-benchmarks"
1168
- ]
1169
-
1170
- if args .skip_build :
1171
- build_script_impl_inferred_args += [
1172
- "--skip-build-cmark" ,
1173
- "--skip-build-llvm" ,
1174
- "--skip-build-swift" ,
1175
- "--skip-build-linux" ,
1176
- "--skip-build-freebsd" ,
1177
- "--skip-build-cygwin" ,
1178
- "--skip-build-osx" ,
1179
- "--skip-build-ios" ,
1180
- "--skip-build-ios-device" ,
1181
- "--skip-build-ios-simulator" ,
1182
- "--skip-build-tvos" ,
1183
- "--skip-build-tvos-device" ,
1184
- "--skip-build-tvos-simulator" ,
1185
- "--skip-build-watchos" ,
1186
- "--skip-build-watchos-device" ,
1187
- "--skip-build-watchos-simulator" ,
1188
- "--skip-build-android" ,
1189
- "--skip-build-lldb" ,
1190
- "--skip-build-llbuild" ,
1191
- "--skip-build-swiftpm" ,
1192
- "--skip-build-xctest" ,
1193
- "--skip-build-foundation" ,
1194
- "--skip-build-libdispatch" ,
1195
- "--skip-build-benchmarks" ,
1196
- ]
1197
-
1198
- if platform .system () == 'Darwin' :
1199
- build_script_impl_inferred_args += [
1200
- "--toolchain-prefix" ,
1201
- swift_build_support .targets .darwin_toolchain_prefix (
1202
- args .install_prefix ),
1203
- ]
1087
+ args .skip_test_ios_host = True
1088
+ args .skip_test_tvos_host = True
1089
+ args .skip_test_watchos_host = True
1204
1090
1205
1091
if args .build_subdir is None :
1206
1092
# Create a name for the build directory.
@@ -1279,6 +1165,7 @@ details of the setups of other systems or automated environments.""")
1279
1165
"--swift-build-type" , args .swift_build_variant ,
1280
1166
"--swift-stdlib-build-type" , args .swift_stdlib_build_variant ,
1281
1167
"--lldb-build-type" , args .lldb_build_variant ,
1168
+ "--foundation-build-type" , args .foundation_build_variant ,
1282
1169
"--llvm-enable-assertions" , str (args .llvm_assertions ).lower (),
1283
1170
"--swift-enable-assertions" , str (args .swift_assertions ).lower (),
1284
1171
"--swift-stdlib-enable-assertions" , str (
@@ -1313,25 +1200,69 @@ details of the setups of other systems or automated environments.""")
1313
1200
build_script_impl_args += [
1314
1201
"--install-symroot" , os .path .abspath (args .install_symroot )
1315
1202
]
1316
- if args .build_foundation :
1317
- build_script_impl_args += [
1318
- "--foundation-build-type" , args .foundation_build_variant
1319
- ]
1320
1203
if args .cmake_generator == 'Ninja' and toolchain .ninja is None :
1321
1204
build_script_impl_args += ["--build-ninja" ]
1322
1205
1206
+ if args .skip_build :
1207
+ build_script_impl_args += ["--skip-build-cmark" ,
1208
+ "--skip-build-llvm" ,
1209
+ "--skip-build-swift" ]
1210
+ if args .skip_build_benchmarks :
1211
+ build_script_impl_args += ["--skip-build-benchmarks" ]
1212
+ if not args .build_foundation :
1213
+ build_script_impl_args += ["--skip-build-foundation" ]
1214
+ if not args .build_xctest :
1215
+ build_script_impl_args += ["--skip-build-xctest" ]
1216
+ if not args .build_lldb :
1217
+ build_script_impl_args += ["--skip-build-lldb" ]
1218
+ if not args .build_llbuild :
1219
+ build_script_impl_args += ["--skip-build-llbuild" ]
1220
+ if not args .build_libdispatch :
1221
+ build_script_impl_args += ["--skip-build-libdispatch" ]
1222
+ if not args .build_swiftpm :
1223
+ build_script_impl_args += ["--skip-build-swiftpm" ]
1224
+
1323
1225
if args .skip_build_linux :
1324
1226
build_script_impl_args += ["--skip-build-linux" ]
1325
1227
if args .skip_build_freebsd :
1326
1228
build_script_impl_args += ["--skip-build-freebsd" ]
1327
1229
if args .skip_build_cygwin :
1328
1230
build_script_impl_args += ["--skip-build-cygwin" ]
1231
+ if args .skip_build_osx :
1232
+ build_script_impl_args += ["--skip-build-osx" ]
1233
+ if not args .ios or args .skip_build :
1234
+ build_script_impl_args += ["--skip-build-ios" ,
1235
+ "--skip-build-ios-device" ,
1236
+ "--skip-build-ios-simulator" ]
1237
+ if not args .tvos or args .skip_build :
1238
+ build_script_impl_args += ["--skip-build-tvos" ,
1239
+ "--skip-build-tvos-device" ,
1240
+ "--skip-build-tvos-simulator" ]
1241
+ if not args .watchos or args .skip_build :
1242
+ build_script_impl_args += ["--skip-build-watchos" ,
1243
+ "--skip-build-watchos-device" ,
1244
+ "--skip-build-watchos-simulator" ]
1245
+ if not args .android or args .skip_build :
1246
+ build_script_impl_args += ["--skip-build-android" ]
1247
+
1248
+ if not args .test and not args .long_test :
1249
+ build_script_impl_args += ["--skip-test-swift" ]
1250
+ if not args .test :
1251
+ build_script_impl_args += ["--skip-test-cmark" ,
1252
+ "--skip-test-lldb" ,
1253
+ "--skip-test-llbuild" ,
1254
+ "--skip-test-swiftpm" ,
1255
+ "--skip-test-xctest" ,
1256
+ "--skip-test-foundation" ,
1257
+ "--skip-test-libdispatch" ]
1329
1258
if args .skip_test_linux :
1330
1259
build_script_impl_args += ["--skip-test-linux" ]
1331
1260
if args .skip_test_freebsd :
1332
1261
build_script_impl_args += ["--skip-test-freebsd" ]
1333
1262
if args .skip_test_cygwin :
1334
1263
build_script_impl_args += ["--skip-test-cygwin" ]
1264
+ if args .skip_test_osx :
1265
+ build_script_impl_args += ["--skip-test-osx" ]
1335
1266
if args .skip_test_ios_host :
1336
1267
build_script_impl_args += ["--skip-test-ios-host" ]
1337
1268
if args .skip_test_ios_simulator :
@@ -1346,6 +1277,14 @@ details of the setups of other systems or automated environments.""")
1346
1277
build_script_impl_args += ["--skip-test-watchos-simulator" ]
1347
1278
if args .build_runtime_with_host_compiler :
1348
1279
build_script_impl_args += ["--build-runtime-with-host-compiler" ]
1280
+ if args .validation_test :
1281
+ build_script_impl_args += ["--validation-test" ]
1282
+ if args .long_test :
1283
+ build_script_impl_args += ["--long-test" ]
1284
+ if not args .benchmark :
1285
+ build_script_impl_args += ["--skip-test-benchmarks" ]
1286
+ if not args .test_optimized :
1287
+ build_script_impl_args += ["--skip-test-optimized" ]
1349
1288
1350
1289
if args .android :
1351
1290
build_script_impl_args += [
@@ -1359,7 +1298,12 @@ details of the setups of other systems or automated environments.""")
1359
1298
"--android-icu-i18n-include" , args .android_icu_i18n_include ,
1360
1299
]
1361
1300
1362
- build_script_impl_args += build_script_impl_inferred_args
1301
+ if platform .system () == 'Darwin' :
1302
+ build_script_impl_args += [
1303
+ "--toolchain-prefix" ,
1304
+ swift_build_support .targets .darwin_toolchain_prefix (
1305
+ args .install_prefix ),
1306
+ ]
1363
1307
1364
1308
# If we have extra_swift_args, combine all of them together and then add
1365
1309
# them as one command.
0 commit comments