summaryrefslogtreecommitdiff
path: root/test/rules
diff options
context:
space:
mode:
authorKeith Smiley <keithbsmiley@gmail.com>2023-08-21 14:47:16 -0700
committerGitHub <noreply@github.com>2023-08-21 16:47:16 -0500
commitf72056a932df112f2b262f8a2bd326cc340f2499 (patch)
tree8d0a57698ac526502bb3586df6d6ebcc66ff8693 /test/rules
parent48a8ff8fea94a5057409bdf5be537945c241f361 (diff)
downloadbazelbuild-apple_support-f72056a932df112f2b262f8a2bd326cc340f2499.tar.gz
Move symbol stripping test to starlark (#246)
This also verifies not passing the required flags keeps the symbols just in case we change that default accidentally
Diffstat (limited to 'test/rules')
-rw-r--r--test/rules/apple_verification_test.bzl25
1 files changed, 23 insertions, 2 deletions
diff --git a/test/rules/apple_verification_test.bzl b/test/rules/apple_verification_test.bzl
index b34456b..0108f44 100644
--- a/test/rules/apple_verification_test.bzl
+++ b/test/rules/apple_verification_test.bzl
@@ -20,9 +20,11 @@ _supports_visionos = hasattr(apple_common.platform_type, "visionos")
def _transition_impl(_, attr):
output_dictionary = {
+ "//command_line_option:compilation_mode": attr.compilation_mode,
"//command_line_option:cpu": "darwin_x86_64",
"//command_line_option:ios_signing_cert_name": "-",
"//command_line_option:macos_cpus": "x86_64",
+ "//command_line_option:objc_enable_binary_stripping": attr.objc_enable_binary_stripping,
}
if attr.build_type == "simulator":
output_dictionary.update({
@@ -54,10 +56,12 @@ _transition = transition(
implementation = _transition_impl,
inputs = [],
outputs = [
+ "//command_line_option:compilation_mode",
"//command_line_option:cpu",
"//command_line_option:ios_multi_cpus",
"//command_line_option:ios_signing_cert_name",
"//command_line_option:macos_cpus",
+ "//command_line_option:objc_enable_binary_stripping",
"//command_line_option:tvos_cpus",
"//command_line_option:watchos_cpus",
] + (["//command_line_option:visionos_cpus"] if _supports_visionos else []),
@@ -113,10 +117,13 @@ apple_verification_test = rule(
Type of build for the target under test. Possible values are `simulator` or `device`.
""",
),
- "expected_platform_type": attr.string(
+ "compilation_mode": attr.string(
+ values = ["fastbuild", "opt", "dbg"],
doc = """
-The apple_platform_type the binary should have been built for.
+Possible values are `fastbuild`, `dbg` or `opt`. Defaults to `fastbuild`.
+https://docs.bazel.build/versions/master/user-manual.html#flag--compilation_mode
""",
+ default = "fastbuild",
),
"cpus": attr.string_dict(
doc = """
@@ -124,6 +131,20 @@ Dictionary of command line options cpu flags and the list of
cpu's to use for test under target (e.g. {'ios_multi_cpus': ['arm64', 'x86_64']})
""",
),
+ "expected_platform_type": attr.string(
+ default = "",
+ doc = """
+The apple_platform_type the binary should have been built for.
+""",
+ ),
+ "objc_enable_binary_stripping": attr.bool(
+ default = False,
+ doc = """
+Whether to perform symbol and dead-code strippings on linked binaries. Binary
+strippings will be performed if both this flag and --compilation_mode=opt are
+specified.
+""",
+ ),
"target_under_test": attr.label(
mandatory = True,
doc = "The binary being verified.",