2222 "//test/starlark_tests/rules:analysis_runfiles_test.bzl" ,
2323 "analysis_runfiles_dsym_test" ,
2424)
25+ load (
26+ "//test/starlark_tests/rules:analysis_target_actions_test.bzl" ,
27+ "make_analysis_target_actions_test" ,
28+ )
2529load (
2630 "//test/starlark_tests/rules:apple_dsym_bundle_info_test.bzl" ,
2731 "apple_dsym_bundle_info_test" ,
4347 "common" ,
4448)
4549
50+ _analysis_macos_strip_enabled_opt_test = make_analysis_target_actions_test (
51+ config_settings = {
52+ "//command_line_option:compilation_mode" : "opt" ,
53+ "//command_line_option:macos_cpus" : "x86_64" ,
54+ "//command_line_option:objc_enable_binary_stripping" : True ,
55+ },
56+ )
57+
58+ _analysis_macos_strip_disabled_opt_test = make_analysis_target_actions_test (
59+ config_settings = {
60+ "//command_line_option:compilation_mode" : "opt" ,
61+ "//command_line_option:macos_cpus" : "x86_64" ,
62+ "//command_line_option:objc_enable_binary_stripping" : False ,
63+ },
64+ )
65+
66+ _analysis_macos_strip_disabled_dbg_test = make_analysis_target_actions_test (
67+ config_settings = {
68+ "//command_line_option:compilation_mode" : "dbg" ,
69+ "//command_line_option:macos_cpus" : "x86_64" ,
70+ "//command_line_option:objc_enable_binary_stripping" : True ,
71+ },
72+ )
73+
4674def macos_command_line_application_test_suite (name ):
4775 """Test suite for macos_command_line_application.
4876
@@ -65,6 +93,32 @@ def macos_command_line_application_test_suite(name):
6593 tags = [name ],
6694 )
6795
96+ # Tests that strip action is registered when building in opt mode with binary stripping enabled.
97+ _analysis_macos_strip_enabled_opt_test (
98+ name = "{}_binary_strip_action_enabled_in_opt_test" .format (name ),
99+ target_under_test = "//test/starlark_tests/targets_under_test/macos:cmd_app_basic" ,
100+ target_mnemonic = "ObjcBinarySymbolStrip" ,
101+ tags = [name ],
102+ )
103+
104+ # Tests that strip action is not registered when in opt mode but stripping is disabled.
105+ _analysis_macos_strip_disabled_opt_test (
106+ name = "{}_binary_strip_action_disabled_without_flag_test" .format (name ),
107+ target_under_test = "//test/starlark_tests/targets_under_test/macos:cmd_app_basic" ,
108+ target_mnemonic = "ObjcLink" ,
109+ not_expected_mnemonic = ["ObjcBinarySymbolStrip" ],
110+ tags = [name ],
111+ )
112+
113+ # Tests that strip action is not registered in dbg mode even if stripping is enabled.
114+ _analysis_macos_strip_disabled_dbg_test (
115+ name = "{}_binary_strip_action_disabled_in_dbg_test" .format (name ),
116+ target_under_test = "//test/starlark_tests/targets_under_test/macos:cmd_app_basic" ,
117+ target_mnemonic = "ObjcLink" ,
118+ not_expected_mnemonic = ["ObjcBinarySymbolStrip" ],
119+ tags = [name ],
120+ )
121+
68122 binary_contents_test (
69123 name = "{}_merged_info_plist_binary_contents_test" .format (name ),
70124 build_type = "device" ,
0 commit comments