summaryrefslogtreecommitdiff
path: root/testsuite.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-09-04 18:05:28 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-09-04 20:49:21 +0200
commita092257a49ed7850913cf53e474f4c8dd175c94b (patch)
tree1024946e748ce2801b03553e78eb9616b0d550da /testsuite.py
parentef5358e8b8174716470b00691fba9946b7d307ce (diff)
Allow macro expansion within symbol names
The C implementation supports this (though it's undocumented, and unused to far). This can be used e.g. to dynamically instatiate symbols from template files: Kconfig.template: config $(subsys)_LOG bool "Enable logging for $(subsys)" depends on $(subsys)_HAS_LOG ... other stuff dependent on $(subsys) Elsewhere: subsys = FOO source "Kconfig.template" subsys = BAR source "Kconfig.template" Pretty sure this can easily be abused, but it should be supported at least.
Diffstat (limited to 'testsuite.py')
-rw-r--r--testsuite.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/testsuite.py b/testsuite.py
index f7f75dd..eb305e0 100644
--- a/testsuite.py
+++ b/testsuite.py
@@ -2398,6 +2398,13 @@ config PRINT_ME
default "\"foo\"" if "foo \"bar\" baz" = ""
""")
+ verify_str(c.syms["PRINT_ME_TOO"], r"""
+config PRINT_ME_TOO
+ bool
+ prompt "foo"
+ default FOOBARBAZQAZ if QAZ && QAZFOO && xxx
+""")
+
def verify_recursive(name):
try:
c.variables[name].expanded_value
@@ -2427,8 +2434,8 @@ config PRINT_ME
verify_variable("shell-stderr-res", "", "", False)
verify_variable("location-res",
- "Kconfiglib/tests/Kpreprocess:119",
- "Kconfiglib/tests/Kpreprocess:119",
+ "Kconfiglib/tests/Kpreprocess:125",
+ "Kconfiglib/tests/Kpreprocess:125",
False)
verify_variable("warning-res", "", "", False)
@@ -2447,8 +2454,8 @@ config PRINT_ME
# Check that the expected warnings were generated
verify_equal(c.warnings, [
- "Kconfiglib/tests/Kpreprocess:116: warning: 'echo message on stderr >&2' wrote to stderr: message on stderr",
- "Kconfiglib/tests/Kpreprocess:124: warning: a warning"
+ "Kconfiglib/tests/Kpreprocess:122: warning: 'echo message on stderr >&2' wrote to stderr: message on stderr",
+ "Kconfiglib/tests/Kpreprocess:130: warning: a warning"
])