Skip to content

Commit 2fbc525

Browse files
committed
Update minimum_os_version for XCTest support in Xcode 15.3. Add additional references to common.bzl test targets where it's convenient.
This leaves the "examples" targets alone, as we're assuming that they should be documentation. Cherry-pick: ce6f443
1 parent 9b2f083 commit 2fbc525

File tree

8 files changed

+88
-28
lines changed

8 files changed

+88
-28
lines changed

test/starlark_tests/common.bzl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ _min_os_ios = struct(
3333
app_intents_support = "16.0",
3434
appclip_support = "14.0",
3535
arm_sim_support = "14.0",
36-
baseline = "12.0",
37-
oldest_supported = "11.0",
38-
nplus1 = "13.0",
36+
baseline = "13.0",
37+
oldest_supported = "12.0",
38+
nplus1 = "14.0",
3939
stable_swift_abi = "12.2",
4040
widget_configuration_intents_support = "16.0",
4141
)
@@ -51,9 +51,9 @@ _min_os_macos = struct(
5151
_min_os_tvos = struct(
5252
app_intents_support = "16.0",
5353
arm_sim_support = "14.0",
54-
baseline = "12.0",
55-
nplus1 = "13.0",
56-
oldest_supported = "11.0",
54+
baseline = "13.0",
55+
oldest_supported = "12.0",
56+
nplus1 = "14.0",
5757
stable_swift_abi = "12.2",
5858
)
5959

test/starlark_tests/ios_framework_tests.bzl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,32 @@ Please remove one of the two from your rule definition.
697697
tags = [name],
698698
)
699699

700+
# Tests that if frameworks and applications have different minimum versions that a user
701+
# actionable error is raised.
702+
analysis_failure_message_test(
703+
name = "{}_app_with_baseline_min_os_and_nplus1_fmwk_produces_error".format(name),
704+
target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_baseline_min_os_and_nplus1_fmwk",
705+
expected_error = """
706+
ERROR: minimum_os_version {framework_version} on the framework //test/starlark_tests/targets_under_test/ios:fmwk_min_os_nplus1 is too high compared to //test/starlark_tests/targets_under_test/ios:app_with_baseline_min_os_and_nplus1_fmwk's minimum_os_version of {app_version}
707+
708+
Please address the minimum_os_version on framework //test/starlark_tests/targets_under_test/ios:fmwk_min_os_nplus1 to match //test/starlark_tests/targets_under_test/ios:app_with_baseline_min_os_and_nplus1_fmwk's minimum_os_version.
709+
""".format(app_version = common.min_os_ios.baseline, framework_version = common.min_os_ios.nplus1),
710+
tags = [name],
711+
)
712+
713+
# Tests that if data-loaded frameworks and applications have different minimum versions that a
714+
# user actionable error is raised.
715+
analysis_failure_message_test(
716+
name = "{}_app_with_baseline_min_os_and_nplus1_transitive_data_fmwk_produces_error".format(name),
717+
target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_nplus1_framework_objc_lib_using_data",
718+
expected_error = """
719+
ERROR: minimum_os_version {framework_version} on the framework //test/starlark_tests/targets_under_test/ios:fmwk_min_os_nplus1 is too high compared to //test/starlark_tests/targets_under_test/ios:app_with_nplus1_framework_objc_lib_using_data's minimum_os_version of {app_version}
720+
721+
Please address the minimum_os_version on framework //test/starlark_tests/targets_under_test/ios:fmwk_min_os_nplus1 to match //test/starlark_tests/targets_under_test/ios:app_with_nplus1_framework_objc_lib_using_data's minimum_os_version.
722+
""".format(app_version = common.min_os_ios.baseline, framework_version = common.min_os_ios.nplus1),
723+
tags = [name],
724+
)
725+
700726
native.test_suite(
701727
name = name,
702728
tags = [name],

test/starlark_tests/targets_under_test/ios/BUILD

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,7 @@ ios_application(
14691469
infoplists = [
14701470
"//test/starlark_tests/resources:Info.plist",
14711471
],
1472-
minimum_os_version = common.min_os_ios.baseline,
1472+
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
14731473
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
14741474
tags = common.fixture_tags,
14751475
deps = [
@@ -1612,7 +1612,7 @@ ios_extension(
16121612
infoplists = [
16131613
"//test/starlark_tests/resources:Info.plist",
16141614
],
1615-
minimum_os_version = common.min_os_ios.baseline,
1615+
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
16161616
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
16171617
tags = common.fixture_tags,
16181618
deps = [
@@ -2271,7 +2271,7 @@ ios_application(
22712271
infoplists = [
22722272
"//test/starlark_tests/resources:Info.plist",
22732273
],
2274-
minimum_os_version = common.min_os_ios.baseline,
2274+
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
22752275
tags = common.fixture_tags,
22762276
deps = [
22772277
":dynamic_fmwk_depending_swift_lib",
@@ -2466,7 +2466,7 @@ ios_application(
24662466
infoplists = [
24672467
"//test/starlark_tests/resources:Info.plist",
24682468
],
2469-
minimum_os_version = common.min_os_ios.baseline,
2469+
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
24702470
tags = common.fixture_tags,
24712471
deps = [
24722472
":swift_static_without_module_interfaces_fmwk_depending_lib",
@@ -2507,7 +2507,7 @@ ios_application(
25072507
infoplists = [
25082508
"//test/starlark_tests/resources:Info.plist",
25092509
],
2510-
minimum_os_version = common.min_os_ios.baseline,
2510+
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
25112511
tags = common.fixture_tags,
25122512
deps = [
25132513
":swift_static_fmwk_depending_swift_lib",
@@ -2656,7 +2656,7 @@ ios_application(
26562656
infoplists = [
26572657
"//test/starlark_tests/resources:Info.plist",
26582658
],
2659-
minimum_os_version = common.min_os_ios.baseline,
2659+
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
26602660
tags = common.fixture_tags,
26612661
deps = [
26622662
":dynamic_objc_xcframework_depending_swift_lib",
@@ -2767,7 +2767,7 @@ ios_application(
27672767
infoplists = [
27682768
"//test/starlark_tests/resources:Info.plist",
27692769
],
2770-
minimum_os_version = common.min_os_ios.baseline,
2770+
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
27712771
tags = common.fixture_tags,
27722772
deps = [
27732773
":dynamic_swift_xcframework_depending_swift_lib",
@@ -2839,7 +2839,7 @@ ios_application(
28392839
infoplists = [
28402840
"//test/starlark_tests/resources:Info.plist",
28412841
],
2842-
minimum_os_version = common.min_os_ios.baseline,
2842+
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
28432843
tags = common.fixture_tags,
28442844
deps = [
28452845
":static_fmwk_depending_swift_lib",
@@ -2960,7 +2960,7 @@ ios_application(
29602960
infoplists = [
29612961
"//test/starlark_tests/resources:Info.plist",
29622962
],
2963-
minimum_os_version = common.min_os_ios.baseline,
2963+
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
29642964
tags = common.fixture_tags,
29652965
deps = [
29662966
":swift_static_xcframework_depending_objc_lib",
@@ -3001,7 +3001,7 @@ ios_application(
30013001
infoplists = [
30023002
"//test/starlark_tests/resources:Info.plist",
30033003
],
3004-
minimum_os_version = common.min_os_ios.baseline,
3004+
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
30053005
tags = common.fixture_tags,
30063006
deps = [
30073007
":swift_static_xcframework_without_swiftmodule_depending_objc_lib",
@@ -3053,7 +3053,7 @@ ios_application(
30533053
bundle_id = "com.google.example",
30543054
families = ["iphone"],
30553055
infoplists = ["//test/starlark_tests/resources:Info.plist"],
3056-
minimum_os_version = common.min_os_ios.baseline,
3056+
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
30573057
tags = common.fixture_tags,
30583058
deps = [
30593059
":static_xcframework_depending_swift_lib",
@@ -3117,7 +3117,7 @@ ios_application(
31173117
bundle_id = "com.google.example",
31183118
families = ["iphone"],
31193119
infoplists = ["//test/starlark_tests/resources:Info.plist"],
3120-
minimum_os_version = common.min_os_ios.baseline,
3120+
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
31213121
tags = common.fixture_tags,
31223122
deps = [
31233123
":static_swift_xcframework_depending_swift_lib",

test/starlark_tests/targets_under_test/tvos/BUILD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ tvos_application(
115115
bundle_id = "com.google.example",
116116
extensions = [":swift_ext"],
117117
infoplists = ["//test/starlark_tests/resources:Info.plist"],
118-
minimum_os_version = common.min_os_tvos.baseline,
118+
minimum_os_version = common.min_os_tvos.oldest_supported, # Before the stable Swift ABI
119119
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
120120
tags = common.fixture_tags,
121121
deps = ["//test/starlark_tests/resources:objc_main_lib"],
@@ -137,7 +137,7 @@ tvos_extension(
137137
bundle_id = "com.google.example.ext",
138138
entitlements = "//test/starlark_tests/resources:entitlements.plist",
139139
infoplists = ["//test/starlark_tests/resources:Info.plist"],
140-
minimum_os_version = common.min_os_tvos.baseline,
140+
minimum_os_version = common.min_os_tvos.oldest_supported, # Before the stable Swift ABI
141141
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
142142
tags = common.fixture_tags,
143143
deps = [
@@ -1062,7 +1062,7 @@ tvos_application(
10621062
infoplists = [
10631063
"//test/starlark_tests/resources:Info.plist",
10641064
],
1065-
minimum_os_version = common.min_os_tvos.baseline,
1065+
minimum_os_version = common.min_os_tvos.oldest_supported, # Before the stable Swift ABI
10661066
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
10671067
tags = common.fixture_tags,
10681068
deps = [":swift_lib"],
@@ -1074,7 +1074,7 @@ tvos_application(
10741074
infoplists = [
10751075
"//test/starlark_tests/resources:Info.plist",
10761076
],
1077-
minimum_os_version = common.min_os_tvos.baseline,
1077+
minimum_os_version = common.min_os_tvos.oldest_supported, # Before the stable Swift ABI
10781078
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
10791079
tags = common.fixture_tags,
10801080
deps = [":objc_to_swift_lib"],

test/starlark_tests/targets_under_test/watchos/BUILD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ watchos_application(
667667
infoplists = [
668668
"//test/starlark_tests/resources:WatchosAppInfo.plist",
669669
],
670-
minimum_os_version = "6.0",
670+
minimum_os_version = common.min_os_watchos.baseline,
671671
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
672672
resources = [
673673
"//test/starlark_tests/resources:example_filegroup",
@@ -712,7 +712,7 @@ ios_application(
712712
infoplists = [
713713
"//test/starlark_tests/resources:Info.plist",
714714
],
715-
minimum_os_version = common.min_os_ios.baseline,
715+
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
716716
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
717717
tags = common.fixture_tags,
718718
watch_application = ":watchos_app_no_swift",
@@ -746,7 +746,7 @@ ios_application(
746746
infoplists = [
747747
"//test/starlark_tests/resources:Info.plist",
748748
],
749-
minimum_os_version = common.min_os_ios.baseline,
749+
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
750750
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
751751
tags = common.fixture_tags,
752752
watch_application = ":watchos_app_swift",
@@ -858,7 +858,7 @@ watchos_application(
858858
infoplists = [
859859
"//test/starlark_tests/resources:WatchosAppInfo.plist",
860860
],
861-
minimum_os_version = "6.0",
861+
minimum_os_version = common.min_os_watchos.stable_swift_abi,
862862
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
863863
tags = common.fixture_tags,
864864
)

test/starlark_tests/tvos_framework_tests.bzl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
"""tvos_framework Starlark tests."""
1616

17+
load(
18+
"//test/starlark_tests/rules:analysis_failure_message_test.bzl",
19+
"analysis_failure_message_test",
20+
)
1721
load(
1822
"//test/starlark_tests/rules:analysis_output_group_info_files_test.bzl",
1923
"analysis_output_group_info_files_test",
@@ -352,6 +356,32 @@ def tvos_framework_test_suite(name):
352356
tags = [name],
353357
)
354358

359+
# Tests that if frameworks and applications have different minimum versions that a user
360+
# actionable error is raised.
361+
analysis_failure_message_test(
362+
name = "{}_app_with_baseline_min_os_and_nplus1_fmwk_produces_error".format(name),
363+
target_under_test = "//test/starlark_tests/targets_under_test/tvos:app_with_baseline_min_os_and_nplus1_fmwk",
364+
expected_error = """
365+
ERROR: minimum_os_version {framework_version} on the framework //test/starlark_tests/targets_under_test/tvos:fmwk_min_os_nplus1 is too high compared to //test/starlark_tests/targets_under_test/tvos:app_with_baseline_min_os_and_nplus1_fmwk's minimum_os_version of {app_version}
366+
367+
Please address the minimum_os_version on framework //test/starlark_tests/targets_under_test/tvos:fmwk_min_os_nplus1 to match //test/starlark_tests/targets_under_test/tvos:app_with_baseline_min_os_and_nplus1_fmwk's minimum_os_version.
368+
""".format(app_version = common.min_os_tvos.baseline, framework_version = common.min_os_tvos.nplus1),
369+
tags = [name],
370+
)
371+
372+
# Tests that if data-loaded frameworks and applications have different minimum versions that a
373+
# user actionable error is raised.
374+
analysis_failure_message_test(
375+
name = "{}_app_with_baseline_min_os_and_nplus1_transitive_data_fmwk_produces_error".format(name),
376+
target_under_test = "//test/starlark_tests/targets_under_test/tvos:app_with_nplus1_framework_objc_lib_using_data",
377+
expected_error = """
378+
ERROR: minimum_os_version {framework_version} on the framework //test/starlark_tests/targets_under_test/tvos:fmwk_min_os_nplus1 is too high compared to //test/starlark_tests/targets_under_test/tvos:app_with_nplus1_framework_objc_lib_using_data's minimum_os_version of {app_version}
379+
380+
Please address the minimum_os_version on framework //test/starlark_tests/targets_under_test/tvos:fmwk_min_os_nplus1 to match //test/starlark_tests/targets_under_test/tvos:app_with_nplus1_framework_objc_lib_using_data's minimum_os_version.
381+
""".format(app_version = common.min_os_tvos.baseline, framework_version = common.min_os_tvos.nplus1),
382+
tags = [name],
383+
)
384+
355385
native.test_suite(
356386
name = name,
357387
tags = [name],

test/starlark_tests/watchos_application_swift_tests.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def watchos_application_swift_test_suite(name):
119119
"bundle/Payload/companion.app/Watch/app.app/app",
120120
"bundle/Payload/companion.app/Watch/app.app/PlugIns/ext.appex/Info.plist",
121121
"bundle/Payload/companion.app/Watch/app.app/PlugIns/ext.appex/ext",
122-
"bundle/SwiftSupport/iphoneos/libswiftCore.dylib",
122+
"bundle/SwiftSupport/watchos/libswiftCore.dylib",
123123
"bundle/WatchKitSupport2/WK",
124124
"dossier/manifest.json",
125125
],

test/testdata/binaries/BUILD

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ load(
33
"//apple:apple_binary.bzl",
44
"apple_binary",
55
)
6+
load(
7+
"//test/starlark_tests:common.bzl",
8+
"common",
9+
)
610

711
# Public only because these are used by the integration tests from generated
812
# workspaces. Please no not depend on them as they can change at any time.
@@ -13,7 +17,7 @@ licenses(["notice"])
1317
apple_binary(
1418
name = "empty_tvos_dylib",
1519
binary_type = "dylib",
16-
minimum_os_version = "11.0",
20+
minimum_os_version = common.min_os_tvos.baseline,
1721
platform_type = "tvos",
1822
deps = [":dummy_lib"],
1923
)

0 commit comments

Comments
 (0)