Skip to content

Commit 73cccad

Browse files
committed
Merge pull request swiftlang#1396 from modocache/build-script-host-test
[SR-237] Move SKIP_TEST_* arguments to Python
2 parents ca2e914 + 03fd72f commit 73cccad

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
@@ -138,13 +138,10 @@ KNOWN_SETTINGS=(
138138
skip-test-freebsd "" "set to skip testing Swift stdlibs for FreeBSD"
139139
skip-test-cygwin "" "set to skip testing Swift stdlibs for Cygwin"
140140
skip-test-osx "" "set to skip testing Swift stdlibs for OSX"
141-
skip-test-ios "" "set to skip testing Swift stdlibs for iOS"
142141
skip-test-ios-simulator "" "set to skip testing Swift stdlibs for iOS simulators (i.e. test devices only)"
143142
skip-test-ios-host "" "set to skip testing the host parts of the iOS toolchain"
144-
skip-test-tvos "" "set to skip testing Swift stdlibs for tvOS"
145143
skip-test-tvos-simulator "" "set to skip testing Swift stdlibs for tvOS simulators (i.e. test devices only)"
146144
skip-test-tvos-host "" "set to skip testing the host parts of the tvOS toolchain"
147-
skip-test-watchos "" "set to skip testing Swift stdlibs for Apple watchOS"
148145
skip-test-watchos-simulator "" "set to skip testing Swift stdlibs for Apple watchOS simulators (i.e. test devices only)"
149146
skip-test-watchos-host "" "set to skip testing the host parts of the watchOS toolchain"
150147
skip-test-validation "" "set to skip validation test suite"
@@ -626,7 +623,6 @@ if [[ "${SKIP_IOS}" ]] ; then
626623
SKIP_BUILD_IOS=1
627624
SKIP_BUILD_IOS_DEVICE=1
628625
SKIP_BUILD_IOS_SIMULATOR=1
629-
SKIP_TEST_IOS=1
630626
SKIP_TEST_IOS_HOST=1
631627
SKIP_TEST_IOS_SIMULATOR=1
632628
fi
@@ -635,7 +631,6 @@ if [[ "${SKIP_TVOS}" ]] ; then
635631
SKIP_BUILD_TVOS=1
636632
SKIP_BUILD_TVOS_DEVICE=1
637633
SKIP_BUILD_TVOS_SIMULATOR=1
638-
SKIP_TEST_TVOS=1
639634
SKIP_TEST_TVOS_HOST=1
640635
SKIP_TEST_TVOS_SIMULATOR=1
641636
fi
@@ -644,7 +639,6 @@ if [[ "${SKIP_WATCHOS}" ]] ; then
644639
SKIP_BUILD_WATCHOS=1
645640
SKIP_BUILD_WATCHOS_DEVICE=1
646641
SKIP_BUILD_WATCHOS_SIMULATOR=1
647-
SKIP_TEST_WATCHOS=1
648642
SKIP_TEST_WATCHOS_HOST=1
649643
SKIP_TEST_WATCHOS_SIMULATOR=1
650644
fi
@@ -653,7 +647,6 @@ if [[ "${SKIP_BUILD_IOS}" ]] ; then
653647
SKIP_BUILD_IOS=1
654648
SKIP_BUILD_IOS_DEVICE=1
655649
SKIP_BUILD_IOS_SIMULATOR=1
656-
SKIP_TEST_IOS=1
657650
SKIP_TEST_IOS_HOST=1
658651
SKIP_TEST_IOS_SIMULATOR=1
659652
fi
@@ -662,7 +655,6 @@ if [[ "${SKIP_BUILD_TVOS}" ]] ; then
662655
SKIP_BUILD_TVOS=1
663656
SKIP_BUILD_TVOS_DEVICE=1
664657
SKIP_BUILD_TVOS_SIMULATOR=1
665-
SKIP_TEST_TVOS=1
666658
SKIP_TEST_TVOS_HOST=1
667659
SKIP_TEST_TVOS_SIMULATOR=1
668660
fi
@@ -671,7 +663,6 @@ if [[ "${SKIP_BUILD_WATCHOS}" ]] ; then
671663
SKIP_BUILD_WATCHOS=1
672664
SKIP_BUILD_WATCHOS_DEVICE=1
673665
SKIP_BUILD_WATCHOS_SIMULATOR=1
674-
SKIP_TEST_WATCHOS=1
675666
SKIP_TEST_WATCHOS_HOST=1
676667
SKIP_TEST_WATCHOS_SIMULATOR=1
677668
fi
@@ -703,21 +694,6 @@ if [[ "${SKIP_BUILD_WATCHOS_SIMULATOR}" ]] ; then
703694
SKIP_TEST_WATCHOS_SIMULATOR=1
704695
fi
705696

706-
if [[ "${SKIP_TEST_IOS}" ]] ; then
707-
SKIP_TEST_IOS_HOST=1
708-
SKIP_TEST_IOS_SIMULATOR=1
709-
fi
710-
711-
if [[ "${SKIP_TEST_TVOS}" ]] ; then
712-
SKIP_TEST_TVOS_HOST=1
713-
SKIP_TEST_TVOS_SIMULATOR=1
714-
fi
715-
716-
if [[ "${SKIP_TEST_WATCHOS}" ]] ; then
717-
SKIP_TEST_WATCHOS_HOST=1
718-
SKIP_TEST_WATCHOS_SIMULATOR=1
719-
fi
720-
721697
# WORKSPACE, BUILD_DIR and INSTALLABLE_PACKAGE must be absolute paths
722698
case "${WORKSPACE}" in
723699
/*) ;;

0 commit comments

Comments
 (0)