File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change 25
25
from os .path import join , isfile , dirname , abspath
26
26
from tools .build_api import get_config
27
27
from tools .targets import set_targets_json_location , Target , TARGET_NAMES
28
- from tools .config import ConfigException , Config
28
+ from tools .config import ConfigException , Config , ConfigParameter , ConfigMacro
29
29
30
30
def compare_config (cfg , expected ):
31
31
"""Compare the output of config against a dictionary of known good results
@@ -196,3 +196,32 @@ def test_basic_regions(target, overrides):
196
196
assert r .size >= 0
197
197
except ConfigException :
198
198
pass
199
+
200
+ def test_parameters_and_config_macros_to_macros ():
201
+ """
202
+ Test that checks that parameter-generated macros get overriden with
203
+ explicitly set macros
204
+ """
205
+
206
+ params = {
207
+ "test_lib.parameter_with_macro" : ConfigParameter (
208
+ "parameter_with_macro" ,
209
+ {
210
+ "macro_name" : "CUSTOM_MACRO_NAME" ,
211
+ "value" : 1
212
+ },
213
+ "test_lib" ,
214
+ "library"
215
+ )
216
+ }
217
+
218
+ macros = {
219
+ "CUSTOM_MACRO_NAME" : ConfigMacro (
220
+ "CUSTOM_MACRO_NAME=2" ,
221
+ "dummy" ,
222
+ "application"
223
+ )
224
+ }
225
+
226
+ macro_list = Config ._parameters_and_config_macros_to_macros (params , macros )
227
+ assert macro_list == ["CUSTOM_MACRO_NAME=2" ]
You can’t perform that action at this time.
0 commit comments