Skip to content

Commit 03fd72f

Browse files
committed
[SR-237] Move SKIP_TEST_* arguments to Python
- Migrate `SKIP_TEST_IOS`, `SKIP_TEST_TVOS`, and `SKIP_TEST_WATCHOS` to Python. - In the `build-script-impl` shellscript, only deal with `SKIP_TEST_*_HOST` and `SKIP_TEST_*_SIMULATOR` variables. - Introduce a `--host-test` flag to the Python `build-script` in order to allow users to specify whether to run host tests. These flags still don't do anything. - Fix typo: `skip-build-tvos_device` was meant to be `skip-build-tvos-device`.
1 parent 940a65a commit 03fd72f

File tree

2 files changed

+93
-31
lines changed

2 files changed

+93
-31
lines changed

utils/build-script

Lines changed: 93 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,9 @@ build the Debug variant of the Swift standard library and SDK overlay""",
494494
run_tests_group.add_argument("-T", "--validation-test",
495495
help="run the validation test suite (implies --test)",
496496
action="store_true")
497+
run_tests_group.add_argument("--host-test",
498+
help="run executable tests on host devices (such as iOS or tvOS)",
499+
action="store_true")
497500
run_tests_group.add_argument("-B", "--benchmark",
498501
help="run the Swift Benchmark Suite after building",
499502
action="store_true")
@@ -530,6 +533,42 @@ build the Debug variant of the Swift standard library and SDK overlay""",
530533
help="skip building Swift Benchmark Suite",
531534
action="store_true")
532535

536+
skip_test_group = parser.add_argument_group(
537+
title="Skip testing specified targets")
538+
skip_test_group.add_argument("--skip-test-ios",
539+
help="skip testing all iOS targets. Equivalent to specifying both "
540+
"--skip-test-ios-simulator and --skip-test-ios-host",
541+
action="store_true")
542+
skip_test_group.add_argument("--skip-test-ios-simulator",
543+
help="skip testing iOS simulator targets",
544+
action="store_true")
545+
skip_test_group.add_argument("--skip-test-ios-host",
546+
help="skip testing iOS device targets on the host machine (the phone "
547+
"itself)",
548+
action="store_true")
549+
skip_test_group.add_argument("--skip-test-tvos",
550+
help="skip testing all tvOS targets. Equivalent to specifying both "
551+
"--skip-test-tvos-simulator and --skip-test-tvos-host",
552+
action="store_true")
553+
skip_test_group.add_argument("--skip-test-tvos-simulator",
554+
help="skip testing tvOS simulator targets",
555+
action="store_true")
556+
skip_test_group.add_argument("--skip-test-tvos-host",
557+
help="skip testing tvOS device targets on the host machine (the TV "
558+
"itself)",
559+
action="store_true")
560+
skip_test_group.add_argument("--skip-test-watchos",
561+
help="skip testing all tvOS targets. Equivalent to specifying both "
562+
"--skip-test-watchos-simulator and --skip-test-watchos-host",
563+
action="store_true")
564+
skip_test_group.add_argument("--skip-test-watchos-simulator",
565+
help="skip testing watchOS simulator targets",
566+
action="store_true")
567+
skip_test_group.add_argument("--skip-test-watchos-host",
568+
help="skip testing watchOS device targets on the host machine (the "
569+
"watch itself)",
570+
action="store_true")
571+
533572
parser.add_argument("-i", "--ios",
534573
help="""
535574
also build for iOS, but disallow tests that require an iOS device""",
@@ -602,6 +641,15 @@ the number of parallel build jobs to use""",
602641
'--install-prefix',
603642
'--install-symroot',
604643
'--symbols-package',
644+
'--skip-test-ios',
645+
'--skip-test-ios-simulator',
646+
'--skip-test-ios-host',
647+
'--skip-test-tvos',
648+
'--skip-test-tvos-simulator',
649+
'--skip-test-tvos-host',
650+
'--skip-test-watchos',
651+
'--skip-test-watchos-simulator',
652+
'--skip-test-watchos-host',
605653
]))
606654

607655
if args.host_target is None:
@@ -681,6 +729,19 @@ the number of parallel build jobs to use""",
681729
if args.test_optimized:
682730
args.test = True
683731

732+
# --skip-test-ios is merely a shorthand for host and simulator tests.
733+
if args.skip_test_ios:
734+
args.skip_test_ios_host = True
735+
args.skip_test_ios_simulator = True
736+
# --skip-test-tvos is merely a shorthand for host and simulator tests.
737+
if args.skip_test_tvos:
738+
args.skip_test_tvos_host = True
739+
args.skip_test_tvos_simulator = True
740+
# --skip-test-watchos is merely a shorthand for host and simulator tests.
741+
if args.skip_test_watchos:
742+
args.skip_test_watchos_host = True
743+
args.skip_test_watchos_simulator = True
744+
684745
build_script_impl_inferred_args = []
685746

686747
if args.export_compile_commands:
@@ -708,16 +769,26 @@ the number of parallel build jobs to use""",
708769
"--skip-test-freebsd",
709770
"--skip-test-cygwin",
710771
"--skip-test-osx",
711-
"--skip-test-ios",
712-
"--skip-test-tvos",
713-
"--skip-test-watchos",
772+
"--skip-test-ios-simulator",
773+
"--skip-test-ios-host",
774+
"--skip-test-tvos-simulator",
775+
"--skip-test-tvos-host",
776+
"--skip-test-watchos-simulator",
777+
"--skip-test-watchos-host",
714778
]
715779

716780
if not args.validation_test:
717781
build_script_impl_inferred_args += [
718782
"--skip-test-validation"
719783
]
720784

785+
if not args.host_test:
786+
build_script_impl_inferred_args += [
787+
"--skip-test-ios-host",
788+
"--skip-test-tvos-host",
789+
"--skip-test-watchos-host",
790+
]
791+
721792
if not args.benchmark:
722793
build_script_impl_inferred_args += [
723794
"--skip-test-benchmarks"
@@ -731,19 +802,22 @@ the number of parallel build jobs to use""",
731802
if not args.ios:
732803
build_script_impl_inferred_args += [
733804
"--skip-build-ios",
734-
"--skip-test-ios"
805+
"--skip-test-ios-simulator",
806+
"--skip-test-ios-host",
735807
]
736808

737809
if not args.tvos:
738810
build_script_impl_inferred_args += [
739811
"--skip-build-tvos",
740-
"--skip-test-tvos",
812+
"--skip-test-tvos-simulator",
813+
"--skip-test-tvos-host",
741814
]
742815

743816
if not args.watchos:
744817
build_script_impl_inferred_args += [
745818
"--skip-build-watchos",
746-
"--skip-test-watchos",
819+
"--skip-test-watchos-simulator",
820+
"--skip-test-watchos-host",
747821
]
748822

749823
if not args.build_lldb:
@@ -794,7 +868,7 @@ the number of parallel build jobs to use""",
794868
"--skip-build-ios-device",
795869
"--skip-build-ios-simulator",
796870
"--skip-build-tvos",
797-
"--skip-build-tvos_device",
871+
"--skip-build-tvos-device",
798872
"--skip-build-tvos-simulator",
799873
"--skip-build-watchos",
800874
"--skip-build-watchos-device",
@@ -931,6 +1005,18 @@ the number of parallel build jobs to use""",
9311005
build_script_impl_args += ["--skip-test-freebsd"]
9321006
if args.skip_test_cygwin:
9331007
build_script_impl_args += ["--skip-test-cygwin"]
1008+
if args.skip_test_ios_host:
1009+
build_script_impl_args += ["--skip-test-ios-host"]
1010+
if args.skip_test_ios_simulator:
1011+
build_script_impl_args += ["--skip-test-ios-simulator"]
1012+
if args.skip_test_tvos_host:
1013+
build_script_impl_args += ["--skip-test-tvos-host"]
1014+
if args.skip_test_tvos_simulator:
1015+
build_script_impl_args += ["--skip-test-tvos-simulator"]
1016+
if args.skip_test_watchos_host:
1017+
build_script_impl_args += ["--skip-test-watchos-host"]
1018+
if args.skip_test_watchos_simulator:
1019+
build_script_impl_args += ["--skip-test-watchos-simulator"]
9341020
build_script_impl_args += build_script_impl_inferred_args
9351021

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

utils/build-script-impl

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,10 @@ KNOWN_SETTINGS=(
137137
skip-test-freebsd "" "set to skip testing Swift stdlibs for FreeBSD"
138138
skip-test-cygwin "" "set to skip testing Swift stdlibs for Cygwin"
139139
skip-test-osx "" "set to skip testing Swift stdlibs for OSX"
140-
skip-test-ios "" "set to skip testing Swift stdlibs for iOS"
141140
skip-test-ios-simulator "" "set to skip testing Swift stdlibs for iOS simulators (i.e. test devices only)"
142141
skip-test-ios-host "" "set to skip testing the host parts of the iOS toolchain"
143-
skip-test-tvos "" "set to skip testing Swift stdlibs for tvOS"
144142
skip-test-tvos-simulator "" "set to skip testing Swift stdlibs for tvOS simulators (i.e. test devices only)"
145143
skip-test-tvos-host "" "set to skip testing the host parts of the tvOS toolchain"
146-
skip-test-watchos "" "set to skip testing Swift stdlibs for Apple watchOS"
147144
skip-test-watchos-simulator "" "set to skip testing Swift stdlibs for Apple watchOS simulators (i.e. test devices only)"
148145
skip-test-watchos-host "" "set to skip testing the host parts of the watchOS toolchain"
149146
skip-test-validation "" "set to skip validation test suite"
@@ -564,7 +561,6 @@ if [[ "${SKIP_IOS}" ]] ; then
564561
SKIP_BUILD_IOS=1
565562
SKIP_BUILD_IOS_DEVICE=1
566563
SKIP_BUILD_IOS_SIMULATOR=1
567-
SKIP_TEST_IOS=1
568564
SKIP_TEST_IOS_HOST=1
569565
SKIP_TEST_IOS_SIMULATOR=1
570566
fi
@@ -573,7 +569,6 @@ if [[ "${SKIP_TVOS}" ]] ; then
573569
SKIP_BUILD_TVOS=1
574570
SKIP_BUILD_TVOS_DEVICE=1
575571
SKIP_BUILD_TVOS_SIMULATOR=1
576-
SKIP_TEST_TVOS=1
577572
SKIP_TEST_TVOS_HOST=1
578573
SKIP_TEST_TVOS_SIMULATOR=1
579574
fi
@@ -582,7 +577,6 @@ if [[ "${SKIP_WATCHOS}" ]] ; then
582577
SKIP_BUILD_WATCHOS=1
583578
SKIP_BUILD_WATCHOS_DEVICE=1
584579
SKIP_BUILD_WATCHOS_SIMULATOR=1
585-
SKIP_TEST_WATCHOS=1
586580
SKIP_TEST_WATCHOS_HOST=1
587581
SKIP_TEST_WATCHOS_SIMULATOR=1
588582
fi
@@ -591,7 +585,6 @@ if [[ "${SKIP_BUILD_IOS}" ]] ; then
591585
SKIP_BUILD_IOS=1
592586
SKIP_BUILD_IOS_DEVICE=1
593587
SKIP_BUILD_IOS_SIMULATOR=1
594-
SKIP_TEST_IOS=1
595588
SKIP_TEST_IOS_HOST=1
596589
SKIP_TEST_IOS_SIMULATOR=1
597590
fi
@@ -600,7 +593,6 @@ if [[ "${SKIP_BUILD_TVOS}" ]] ; then
600593
SKIP_BUILD_TVOS=1
601594
SKIP_BUILD_TVOS_DEVICE=1
602595
SKIP_BUILD_TVOS_SIMULATOR=1
603-
SKIP_TEST_TVOS=1
604596
SKIP_TEST_TVOS_HOST=1
605597
SKIP_TEST_TVOS_SIMULATOR=1
606598
fi
@@ -609,7 +601,6 @@ if [[ "${SKIP_BUILD_WATCHOS}" ]] ; then
609601
SKIP_BUILD_WATCHOS=1
610602
SKIP_BUILD_WATCHOS_DEVICE=1
611603
SKIP_BUILD_WATCHOS_SIMULATOR=1
612-
SKIP_TEST_WATCHOS=1
613604
SKIP_TEST_WATCHOS_HOST=1
614605
SKIP_TEST_WATCHOS_SIMULATOR=1
615606
fi
@@ -641,21 +632,6 @@ if [[ "${SKIP_BUILD_WATCHOS_SIMULATOR}" ]] ; then
641632
SKIP_TEST_WATCHOS_SIMULATOR=1
642633
fi
643634

644-
if [[ "${SKIP_TEST_IOS}" ]] ; then
645-
SKIP_TEST_IOS_HOST=1
646-
SKIP_TEST_IOS_SIMULATOR=1
647-
fi
648-
649-
if [[ "${SKIP_TEST_TVOS}" ]] ; then
650-
SKIP_TEST_TVOS_HOST=1
651-
SKIP_TEST_TVOS_SIMULATOR=1
652-
fi
653-
654-
if [[ "${SKIP_TEST_WATCHOS}" ]] ; then
655-
SKIP_TEST_WATCHOS_HOST=1
656-
SKIP_TEST_WATCHOS_SIMULATOR=1
657-
fi
658-
659635
# WORKSPACE, BUILD_DIR and INSTALLABLE_PACKAGE must be absolute paths
660636
case "${WORKSPACE}" in
661637
/*) ;;

0 commit comments

Comments
 (0)