From e08b6957ca935fc97eddd1afda933715016b9b11 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 18 Jul 2018 03:05:37 +0200 Subject: Add def_int, def_hex, and def_string keywords Analogous to def_bool and def_tristate, setting the type and adding a default at the same time. This is a Kconfiglib extension. These keywords can be useful in projects that make use of symbols defined in multiple locations, and remove some Kconfig inconsistency. --- testsuite.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'testsuite.py') diff --git a/testsuite.py b/testsuite.py index 0f42d69..f70c7e9 100644 --- a/testsuite.py +++ b/testsuite.py @@ -467,7 +467,7 @@ def run_selftests(): verify_eval_bad("|| X") - print("Testing Symbol.__str__()") + print("Testing Symbol.__str__() and def_{int,hex,string}") def verify_str(item, s): verify_equal(str(item), s[1:]) @@ -545,6 +545,16 @@ config INT range 1 2 range FOO BAR range BAZ QAZ if DEP + default 7 if DEP +""") + + verify_str(c.syms["HEX"], """ +config HEX + hex + range 0x100 0x200 + range FOO BAR + range BAZ QAZ if DEP + default 0x123 """) verify_str(c.modules, """ -- cgit v1.2.3