File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -1081,8 +1081,8 @@ def _check_required_parameters(params):
1081
1081
def _parameters_and_config_macros_to_macros (params , macros ):
1082
1082
""" Return the macro definitions generated for a dictionary of
1083
1083
ConfigParameters and a dictionary of ConfigMacros (as returned by
1084
- get_config_data). The ConfigMacros override any matching macros set by
1085
- the ConfigParameters .
1084
+ get_config_data). The ConfigParameters override any matching macros set
1085
+ by the ConfigMacros .
1086
1086
1087
1087
Positional arguments:
1088
1088
params - a dictionary mapping a name to a ConfigParameter
@@ -1091,14 +1091,14 @@ def _parameters_and_config_macros_to_macros(params, macros):
1091
1091
Return: a list of strings that are the C pre-processor macros
1092
1092
"""
1093
1093
all_macros = {
1094
- p .macro_name : p . value for p in params .values () if p . value is not None
1094
+ m .macro_name : m . macro_value for m in macros .values ()
1095
1095
}
1096
1096
1097
- config_macros = {
1098
- m .macro_name : m . macro_value for m in macros .values ()
1097
+ parameter_macros = {
1098
+ p .macro_name : p . value for p in params .values () if p . value is not None
1099
1099
}
1100
1100
1101
- all_macros .update (config_macros )
1101
+ all_macros .update (parameter_macros )
1102
1102
macro_list = []
1103
1103
for name , value in all_macros .items ():
1104
1104
# If the macro does not have a value, just append the name.
Original file line number Diff line number Diff line change @@ -199,8 +199,7 @@ def test_basic_regions(target, overrides):
199
199
200
200
def test_parameters_and_config_macros_to_macros ():
201
201
"""
202
- Test that checks that parameter-generated macros get overriden with
203
- explicitly set macros
202
+ Test that checks that parameter-generated macros override set macros
204
203
"""
205
204
206
205
params = {
@@ -224,4 +223,4 @@ def test_parameters_and_config_macros_to_macros():
224
223
}
225
224
226
225
macro_list = Config ._parameters_and_config_macros_to_macros (params , macros )
227
- assert macro_list == ["CUSTOM_MACRO_NAME=2 " ]
226
+ assert macro_list == ["CUSTOM_MACRO_NAME=1 " ]
You can’t perform that action at this time.
0 commit comments