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 @@ -1095,8 +1095,8 @@ def _check_required_parameters(params):
1095
1095
def _parameters_and_config_macros_to_macros (params , macros ):
1096
1096
""" Return the macro definitions generated for a dictionary of
1097
1097
ConfigParameters and a dictionary of ConfigMacros (as returned by
1098
- get_config_data). The ConfigMacros override any matching macros set by
1099
- the ConfigParameters .
1098
+ get_config_data). The ConfigParameters override any matching macros set
1099
+ by the ConfigMacros .
1100
1100
1101
1101
Positional arguments:
1102
1102
params - a dictionary mapping a name to a ConfigParameter
@@ -1105,14 +1105,14 @@ def _parameters_and_config_macros_to_macros(params, macros):
1105
1105
Return: a list of strings that are the C pre-processor macros
1106
1106
"""
1107
1107
all_macros = {
1108
- p .macro_name : p . value for p in params .values () if p . value is not None
1108
+ m .macro_name : m . macro_value for m in macros .values ()
1109
1109
}
1110
1110
1111
- config_macros = {
1112
- m .macro_name : m . macro_value for m in macros .values ()
1111
+ parameter_macros = {
1112
+ p .macro_name : p . value for p in params .values () if p . value is not None
1113
1113
}
1114
1114
1115
- all_macros .update (config_macros )
1115
+ all_macros .update (parameter_macros )
1116
1116
macro_list = []
1117
1117
for name , value in all_macros .items ():
1118
1118
# 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