Skip to content

Commit 213d81d

Browse files
committed
[build-script] Skip option for non-Darwin stdlib tests
It's possible to cross-compile for iOS while skipping stdlib tests on OS X: ``` $ utils/build-script --ios -- --skip-test-osx ``` The same is not possible on Linux. Add options to skip builds and tests on non-Darwin platforms: Linux, FreeBSD, and Cygwin.
1 parent a14ecfb commit 213d81d

File tree

2 files changed

+49
-6
lines changed

2 files changed

+49
-6
lines changed

utils/build-script

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,15 @@ build the Debug variant of the Swift standard library and SDK overlay""",
497497
run_tests_group.add_argument("-B", "--benchmark",
498498
help="run the Swift Benchmark Suite after building",
499499
action="store_true")
500+
run_tests_group.add_argument("--skip-test-linux",
501+
help="skip testing Swift stdlibs for Linux",
502+
action="store_true")
503+
run_tests_group.add_argument("--skip-test-freebsd",
504+
help="skip testing Swift stdlibs for FreeBSD",
505+
action="store_true")
506+
run_tests_group.add_argument("--skip-test-cygwin",
507+
help="skip testing Swift stdlibs for Cygwin",
508+
action="store_true")
500509

501510
parser.add_argument("-o", "--test-optimized",
502511
help="run the test suite in optimized mode too (implies --test)",
@@ -507,6 +516,15 @@ build the Debug variant of the Swift standard library and SDK overlay""",
507516
run_build_group.add_argument("-S", "--skip-build",
508517
help="generate build directory only without building",
509518
action="store_true")
519+
run_build_group.add_argument("--skip-build-linux",
520+
help="skip building Swift stdlibs for Linux",
521+
action="store_true")
522+
run_build_group.add_argument("--skip-build-freebsd",
523+
help="skip building Swift stdlibs for FreeBSD",
524+
action="store_true")
525+
run_build_group.add_argument("--skip-build-cygwin",
526+
help="skip building Swift stdlibs for Cygwin",
527+
action="store_true")
510528

511529
run_build_group.add_argument("--skip-build-benchmarks",
512530
help="skip building Swift Benchmark Suite",
@@ -686,6 +704,10 @@ the number of parallel build jobs to use""",
686704
"--skip-test-xctest",
687705
"--skip-test-foundation",
688706
"--skip-test-libdispatch",
707+
"--skip-test-linux",
708+
"--skip-test-freebsd",
709+
"--skip-test-cygwin",
710+
"--skip-test-osx",
689711
"--skip-test-ios",
690712
"--skip-test-tvos",
691713
"--skip-test-watchos",
@@ -764,6 +786,9 @@ the number of parallel build jobs to use""",
764786
"--skip-build-cmark",
765787
"--skip-build-llvm",
766788
"--skip-build-swift",
789+
"--skip-build-linux",
790+
"--skip-build-freebsd",
791+
"--skip-build-cygwin",
767792
"--skip-build-osx",
768793
"--skip-build-ios",
769794
"--skip-build-ios-device",
@@ -890,6 +915,18 @@ the number of parallel build jobs to use""",
890915
if args.cmake_generator == 'Ninja' and \
891916
not swift_build_support.ninja.is_ninja_installed():
892917
build_script_impl_args += ["--build-ninja"]
918+
if args.skip_build_linux:
919+
build_script_impl_args += ["--skip-build-linux"]
920+
if args.skip_build_freebsd:
921+
build_script_impl_args += ["--skip-build-freebsd"]
922+
if args.skip_build_cygwin:
923+
build_script_impl_args += ["--skip-build-cygwin"]
924+
if args.skip_test_linux:
925+
build_script_impl_args += ["--skip-test-linux"]
926+
if args.skip_test_freebsd:
927+
build_script_impl_args += ["--skip-test-freebsd"]
928+
if args.skip_test_cygwin:
929+
build_script_impl_args += ["--skip-test-cygwin"]
893930
build_script_impl_args += build_script_impl_inferred_args
894931

895932
# If we have extra_swift_args, combine all of them together and then add

utils/build-script-impl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ KNOWN_SETTINGS=(
104104
skip-build-cmark "" "set to skip building CommonMark"
105105
skip-build-llvm "" "set to skip building LLVM/Clang"
106106
skip-build-swift "" "set to skip building Swift"
107+
skip-build-linux "" "set to skip building Swift stdlibs for Linux"
108+
skip-build-freebsd "" "set to skip building Swift stdlibs for FreeBSD"
109+
skip-build-cygwin "" "set to skip building Swift stdlibs for Cygwin"
107110
skip-build-osx "" "set to skip building Swift stdlibs for OSX"
108111
skip-build-ios "" "set to skip building Swift stdlibs for iOS"
109112
skip-build-ios-device "" "set to skip building Swift stdlibs for iOS devices (i.e. build simulators only)"
@@ -129,6 +132,9 @@ KNOWN_SETTINGS=(
129132
skip-test-xctest "" "set to skip testing xctest"
130133
skip-test-foundation "" "set to skip testing foundation"
131134
skip-test-libdispatch "" "set to skip testing libdispatch"
135+
skip-test-linux "" "set to skip testing Swift stdlibs for Linux"
136+
skip-test-freebsd "" "set to skip testing Swift stdlibs for FreeBSD"
137+
skip-test-cygwin "" "set to skip testing Swift stdlibs for Cygwin"
132138
skip-test-osx "" "set to skip testing Swift stdlibs for OSX"
133139
skip-test-ios "" "set to skip testing Swift stdlibs for iOS"
134140
skip-test-ios-simulator "" "set to skip testing Swift stdlibs for iOS simulators (i.e. test devices only)"
@@ -906,16 +912,16 @@ for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do
906912
test_benchmark_this_target=
907913
case ${deployment_target} in
908914
linux-*)
909-
build_for_this_target=1
910-
test_this_target=1
915+
build_for_this_target=$(not ${SKIP_BUILD_LINUX})
916+
test_this_target=$(not ${SKIP_TEST_LINUX})
911917
;;
912918
freebsd-*)
913-
build_for_this_target=1
914-
test_this_target=1
919+
build_for_this_target=$(not ${SKIP_BUILD_FREEBSD})
920+
test_this_target=$(not ${SKIP_TEST_FREEBSD})
915921
;;
916922
cygwin-*)
917-
build_for_this_target=1
918-
test_this_target=1
923+
build_for_this_target=$(not ${SKIP_BUILD_CYGWIN})
924+
test_this_target=$(not ${SKIP_TEST_CYGWIN})
919925
;;
920926
macosx-*)
921927
build_for_this_target=$(not ${SKIP_BUILD_OSX})

0 commit comments

Comments
 (0)