Skip to content

Commit a5bcde1

Browse files
nglevinluispadron
authored andcommitted
Add binary_contents_tests to cover arm64e and arm64e + arm64 multiarch for static library archives.
Cherry-pick: 658c95e
1 parent 10c27f6 commit a5bcde1

1 file changed

Lines changed: 48 additions & 1 deletion

File tree

test/starlark_tests/apple_static_library_tests.bzl

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,27 @@ def apple_static_library_test_suite(name):
189189
tags = [name],
190190
)
191191

192+
# Test that the output binary is identified as iOS device (PLATFORM_IOS) arm64e static library
193+
# archive via the Mach-O load command LC_BUILD_VERSION for an Arm binary when specifying the
194+
# outputs via the platforms command line option.
195+
binary_contents_test(
196+
name = "{}_ios_binary_contents_device_arm64e_apple_platforms_test".format(name),
197+
cpus = {
198+
"platforms": ["@build_bazel_apple_support//platforms:ios_arm64e"],
199+
"ios_multi_cpus": [],
200+
},
201+
build_type = "device",
202+
target_under_test = "//test/starlark_tests/targets_under_test/apple/static_library:example_library_arm_sim_support",
203+
binary_test_file = "$BINARY",
204+
binary_test_architecture = "arm64e",
205+
macho_load_commands_contain = ["cmd LC_BUILD_VERSION", "minos " + common.min_os_ios.baseline, "platform IOS"],
206+
tags = [name],
207+
)
208+
192209
# Test that the output binary is identified as iOS device (PLATFORM_IOS) via the Mach-O load
193210
# command LC_BUILD_VERSION for an Arm binary.
194211
binary_contents_test(
195-
name = "{}_ios_binary_contents_device_platform_test".format(name),
212+
name = "{}_ios_binary_contents_device_arm64_platform_test".format(name),
196213
build_type = "device",
197214
target_under_test = "//test/starlark_tests/targets_under_test/apple/static_library:example_library_arm_sim_support",
198215
cpus = {
@@ -204,6 +221,36 @@ def apple_static_library_test_suite(name):
204221
tags = [name],
205222
)
206223

224+
# Test that the output binary is identified as iOS device (PLATFORM_IOS) via the Mach-O load
225+
# command LC_BUILD_VERSION for an arm64 + arm64e binary on the arm64 slice.
226+
binary_contents_test(
227+
name = "{}_ios_binary_contents_device_multiarch_arm64_platform_test".format(name),
228+
build_type = "device",
229+
target_under_test = "//test/starlark_tests/targets_under_test/apple/static_library:example_library_arm_sim_support",
230+
cpus = {
231+
"ios_multi_cpus": ["arm64", "arm64e"],
232+
},
233+
binary_test_file = "$BINARY",
234+
binary_test_architecture = "arm64",
235+
macho_load_commands_contain = ["cmd LC_BUILD_VERSION", "minos " + common.min_os_ios.baseline, "platform IOS"],
236+
tags = [name],
237+
)
238+
239+
# Test that the output binary is identified as iOS device (PLATFORM_IOS) via the Mach-O load
240+
# command LC_BUILD_VERSION for an arm64 + arm64e binary on the arm64e slice.
241+
binary_contents_test(
242+
name = "{}_ios_binary_contents_device_multiarch_arm64e_platform_test".format(name),
243+
build_type = "device",
244+
target_under_test = "//test/starlark_tests/targets_under_test/apple/static_library:example_library_arm_sim_support",
245+
cpus = {
246+
"ios_multi_cpus": ["arm64", "arm64e"],
247+
},
248+
binary_test_file = "$BINARY",
249+
binary_test_architecture = "arm64e",
250+
macho_load_commands_contain = ["cmd LC_BUILD_VERSION", "minos " + common.min_os_ios.baseline, "platform IOS"],
251+
tags = [name],
252+
)
253+
207254
# Test that the output binary is identified as iOS device (PLATFORM_IOS) via the Mach-O load
208255
# command LC_BUILD_VERSION for an Intel binary when specifying the outputs via the
209256
# apple_platforms command line option.

0 commit comments

Comments
 (0)