@@ -50,6 +50,7 @@ _SIMPLE_FILES = [
5050 "tests/rule_based_toolchain/testdata/multiple2" ,
5151]
5252_TOOL_DIRECTORY = "tests/rule_based_toolchain/testdata"
53+ _OVERRIDDEN_MIN_OS = "-mmacosx-version-min=13.0"
5354
5455_CONVERTED_ARGS = subjects .struct (
5556 flag_sets = subjects .collection ,
@@ -190,12 +191,34 @@ def _build_setting_format_test(env, targets):
190191 flag_groups = [flag_group (flags = ["-mmacosx-version-min=12.0" ])],
191192 )])
192193
194+ def _build_setting_format_override_test (env , targets ):
195+ build_setting = env .expect .that_target (targets .build_setting_format_override ).provider (ArgsInfo )
196+ build_setting .actions ().contains_exactly ([
197+ targets .c_compile .label ,
198+ targets .cpp_compile .label ,
199+ ])
200+ build_setting .env ().entries ().contains_exactly ({"APPLE_MIN_OS" : _OVERRIDDEN_MIN_OS })
201+
202+ converted = env .expect .that_value (
203+ convert_args (targets .build_setting_format_override [ArgsInfo ]),
204+ factory = _CONVERTED_ARGS ,
205+ )
206+ converted .env_sets ().contains_exactly ([env_set (
207+ actions = ["c_compile" , "cpp_compile" ],
208+ env_entries = [env_entry (key = "APPLE_MIN_OS" , value = _OVERRIDDEN_MIN_OS )],
209+ )])
210+ converted .flag_sets ().contains_exactly ([flag_set (
211+ actions = ["c_compile" , "cpp_compile" ],
212+ flag_groups = [flag_group (flags = [_OVERRIDDEN_MIN_OS ])],
213+ )])
214+
193215TARGETS = [
194216 ":simple" ,
195217 ":some_variable" ,
196218 ":env_only" ,
197219 ":env_only_requires" ,
198220 ":build_setting_format" ,
221+ ":build_setting_format_override" ,
199222 ":with_dir" ,
200223 ":with_dir_and_data" ,
201224 ":iterate_over_optional" ,
@@ -384,6 +407,7 @@ TESTS = {
384407 "with_dir_test" : _with_dir_test ,
385408 "with_dir_and_data_test" : _with_dir_and_data_test ,
386409 "build_setting_format_test" : _build_setting_format_test ,
410+ "build_setting_format_override_test" : _build_setting_format_override_test ,
387411 "good_env_format_test" : _good_env_format_test ,
388412 "good_env_format_optional_test" : _good_env_format_optional_test ,
389413}
0 commit comments