Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions test/starlark_tests/common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ _min_os_ios = struct(
app_intents_support = "16.0",
appclip_support = "14.0",
arm_sim_support = "14.0",
baseline = "12.0",
oldest_supported = "11.0",
nplus1 = "13.0",
baseline = "13.0",
oldest_supported = "12.0",
nplus1 = "14.0",
stable_swift_abi = "12.2",
widget_configuration_intents_support = "16.0",
)
Expand All @@ -51,9 +51,9 @@ _min_os_macos = struct(
_min_os_tvos = struct(
app_intents_support = "16.0",
arm_sim_support = "14.0",
baseline = "12.0",
nplus1 = "13.0",
oldest_supported = "11.0",
baseline = "13.0",
oldest_supported = "12.0",
nplus1 = "14.0",
stable_swift_abi = "12.2",
)

Expand Down
26 changes: 26 additions & 0 deletions test/starlark_tests/ios_framework_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,32 @@ Please remove one of the two from your rule definition.
tags = [name],
)

# Tests that if frameworks and applications have different minimum versions that a user
# actionable error is raised.
analysis_failure_message_test(
name = "{}_app_with_baseline_min_os_and_nplus1_fmwk_produces_error".format(name),
target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_baseline_min_os_and_nplus1_fmwk",
expected_error = """
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}

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.
""".format(app_version = common.min_os_ios.baseline, framework_version = common.min_os_ios.nplus1),
tags = [name],
)

# Tests that if data-loaded frameworks and applications have different minimum versions that a
# user actionable error is raised.
analysis_failure_message_test(
name = "{}_app_with_baseline_min_os_and_nplus1_transitive_data_fmwk_produces_error".format(name),
target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_nplus1_framework_objc_lib_using_data",
expected_error = """
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}

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.
""".format(app_version = common.min_os_ios.baseline, framework_version = common.min_os_ios.nplus1),
tags = [name],
)

native.test_suite(
name = name,
tags = [name],
Expand Down
24 changes: 12 additions & 12 deletions test/starlark_tests/targets_under_test/ios/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,7 @@ ios_application(
infoplists = [
"//test/starlark_tests/resources:Info.plist",
],
minimum_os_version = common.min_os_ios.baseline,
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
tags = common.fixture_tags,
deps = [
Expand Down Expand Up @@ -1612,7 +1612,7 @@ ios_extension(
infoplists = [
"//test/starlark_tests/resources:Info.plist",
],
minimum_os_version = common.min_os_ios.baseline,
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
tags = common.fixture_tags,
deps = [
Expand Down Expand Up @@ -2271,7 +2271,7 @@ ios_application(
infoplists = [
"//test/starlark_tests/resources:Info.plist",
],
minimum_os_version = common.min_os_ios.baseline,
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
tags = common.fixture_tags,
deps = [
":dynamic_fmwk_depending_swift_lib",
Expand Down Expand Up @@ -2466,7 +2466,7 @@ ios_application(
infoplists = [
"//test/starlark_tests/resources:Info.plist",
],
minimum_os_version = common.min_os_ios.baseline,
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
tags = common.fixture_tags,
deps = [
":swift_static_without_module_interfaces_fmwk_depending_lib",
Expand Down Expand Up @@ -2507,7 +2507,7 @@ ios_application(
infoplists = [
"//test/starlark_tests/resources:Info.plist",
],
minimum_os_version = common.min_os_ios.baseline,
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
tags = common.fixture_tags,
deps = [
":swift_static_fmwk_depending_swift_lib",
Expand Down Expand Up @@ -2656,7 +2656,7 @@ ios_application(
infoplists = [
"//test/starlark_tests/resources:Info.plist",
],
minimum_os_version = common.min_os_ios.baseline,
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
tags = common.fixture_tags,
deps = [
":dynamic_objc_xcframework_depending_swift_lib",
Expand Down Expand Up @@ -2767,7 +2767,7 @@ ios_application(
infoplists = [
"//test/starlark_tests/resources:Info.plist",
],
minimum_os_version = common.min_os_ios.baseline,
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
tags = common.fixture_tags,
deps = [
":dynamic_swift_xcframework_depending_swift_lib",
Expand Down Expand Up @@ -2839,7 +2839,7 @@ ios_application(
infoplists = [
"//test/starlark_tests/resources:Info.plist",
],
minimum_os_version = common.min_os_ios.baseline,
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
tags = common.fixture_tags,
deps = [
":static_fmwk_depending_swift_lib",
Expand Down Expand Up @@ -2960,7 +2960,7 @@ ios_application(
infoplists = [
"//test/starlark_tests/resources:Info.plist",
],
minimum_os_version = common.min_os_ios.baseline,
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
tags = common.fixture_tags,
deps = [
":swift_static_xcframework_depending_objc_lib",
Expand Down Expand Up @@ -3001,7 +3001,7 @@ ios_application(
infoplists = [
"//test/starlark_tests/resources:Info.plist",
],
minimum_os_version = common.min_os_ios.baseline,
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
tags = common.fixture_tags,
deps = [
":swift_static_xcframework_without_swiftmodule_depending_objc_lib",
Expand Down Expand Up @@ -3053,7 +3053,7 @@ ios_application(
bundle_id = "com.google.example",
families = ["iphone"],
infoplists = ["//test/starlark_tests/resources:Info.plist"],
minimum_os_version = common.min_os_ios.baseline,
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
tags = common.fixture_tags,
deps = [
":static_xcframework_depending_swift_lib",
Expand Down Expand Up @@ -3117,7 +3117,7 @@ ios_application(
bundle_id = "com.google.example",
families = ["iphone"],
infoplists = ["//test/starlark_tests/resources:Info.plist"],
minimum_os_version = common.min_os_ios.baseline,
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
tags = common.fixture_tags,
deps = [
":static_swift_xcframework_depending_swift_lib",
Expand Down
8 changes: 4 additions & 4 deletions test/starlark_tests/targets_under_test/tvos/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ tvos_application(
bundle_id = "com.google.example",
extensions = [":swift_ext"],
infoplists = ["//test/starlark_tests/resources:Info.plist"],
minimum_os_version = common.min_os_tvos.baseline,
minimum_os_version = common.min_os_tvos.oldest_supported, # Before the stable Swift ABI
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
tags = common.fixture_tags,
deps = ["//test/starlark_tests/resources:objc_main_lib"],
Expand All @@ -137,7 +137,7 @@ tvos_extension(
bundle_id = "com.google.example.ext",
entitlements = "//test/starlark_tests/resources:entitlements.plist",
infoplists = ["//test/starlark_tests/resources:Info.plist"],
minimum_os_version = common.min_os_tvos.baseline,
minimum_os_version = common.min_os_tvos.oldest_supported, # Before the stable Swift ABI
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
tags = common.fixture_tags,
deps = [
Expand Down Expand Up @@ -1062,7 +1062,7 @@ tvos_application(
infoplists = [
"//test/starlark_tests/resources:Info.plist",
],
minimum_os_version = common.min_os_tvos.baseline,
minimum_os_version = common.min_os_tvos.oldest_supported, # Before the stable Swift ABI
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
tags = common.fixture_tags,
deps = [":swift_lib"],
Expand All @@ -1074,7 +1074,7 @@ tvos_application(
infoplists = [
"//test/starlark_tests/resources:Info.plist",
],
minimum_os_version = common.min_os_tvos.baseline,
minimum_os_version = common.min_os_tvos.oldest_supported, # Before the stable Swift ABI
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
tags = common.fixture_tags,
deps = [":objc_to_swift_lib"],
Expand Down
8 changes: 4 additions & 4 deletions test/starlark_tests/targets_under_test/watchos/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ watchos_application(
infoplists = [
"//test/starlark_tests/resources:WatchosAppInfo.plist",
],
minimum_os_version = "6.0",
minimum_os_version = common.min_os_watchos.baseline,
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
resources = [
"//test/starlark_tests/resources:example_filegroup",
Expand Down Expand Up @@ -712,7 +712,7 @@ ios_application(
infoplists = [
"//test/starlark_tests/resources:Info.plist",
],
minimum_os_version = common.min_os_ios.baseline,
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
tags = common.fixture_tags,
watch_application = ":watchos_app_no_swift",
Expand Down Expand Up @@ -746,7 +746,7 @@ ios_application(
infoplists = [
"//test/starlark_tests/resources:Info.plist",
],
minimum_os_version = common.min_os_ios.baseline,
minimum_os_version = common.min_os_ios.oldest_supported, # Before the stable Swift ABI
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
tags = common.fixture_tags,
watch_application = ":watchos_app_swift",
Expand Down Expand Up @@ -858,7 +858,7 @@ watchos_application(
infoplists = [
"//test/starlark_tests/resources:WatchosAppInfo.plist",
],
minimum_os_version = "6.0",
minimum_os_version = common.min_os_watchos.stable_swift_abi,
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
tags = common.fixture_tags,
)
Expand Down
30 changes: 30 additions & 0 deletions test/starlark_tests/tvos_framework_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

"""tvos_framework Starlark tests."""

load(
"//test/starlark_tests/rules:analysis_failure_message_test.bzl",
"analysis_failure_message_test",
)
load(
"//test/starlark_tests/rules:analysis_output_group_info_files_test.bzl",
"analysis_output_group_info_files_test",
Expand Down Expand Up @@ -352,6 +356,32 @@ def tvos_framework_test_suite(name):
tags = [name],
)

# Tests that if frameworks and applications have different minimum versions that a user
# actionable error is raised.
analysis_failure_message_test(
name = "{}_app_with_baseline_min_os_and_nplus1_fmwk_produces_error".format(name),
target_under_test = "//test/starlark_tests/targets_under_test/tvos:app_with_baseline_min_os_and_nplus1_fmwk",
expected_error = """
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}

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.
""".format(app_version = common.min_os_tvos.baseline, framework_version = common.min_os_tvos.nplus1),
tags = [name],
)

# Tests that if data-loaded frameworks and applications have different minimum versions that a
# user actionable error is raised.
analysis_failure_message_test(
name = "{}_app_with_baseline_min_os_and_nplus1_transitive_data_fmwk_produces_error".format(name),
target_under_test = "//test/starlark_tests/targets_under_test/tvos:app_with_nplus1_framework_objc_lib_using_data",
expected_error = """
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}

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.
""".format(app_version = common.min_os_tvos.baseline, framework_version = common.min_os_tvos.nplus1),
tags = [name],
)

native.test_suite(
name = name,
tags = [name],
Expand Down
2 changes: 1 addition & 1 deletion test/starlark_tests/watchos_application_swift_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def watchos_application_swift_test_suite(name):
"bundle/Payload/companion.app/Watch/app.app/app",
"bundle/Payload/companion.app/Watch/app.app/PlugIns/ext.appex/Info.plist",
"bundle/Payload/companion.app/Watch/app.app/PlugIns/ext.appex/ext",
"bundle/SwiftSupport/iphoneos/libswiftCore.dylib",
"bundle/SwiftSupport/watchos/libswiftCore.dylib",
"bundle/WatchKitSupport2/WK",
"dossier/manifest.json",
],
Expand Down
6 changes: 5 additions & 1 deletion test/testdata/binaries/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ load(
"//apple:apple_binary.bzl",
"apple_binary",
)
load(
"//test/starlark_tests:common.bzl",
"common",
)

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