From dd0e227216e247d2040cdd40bf7397702880cdc4 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Mon, 9 Oct 2017 23:05:00 +0200 Subject: Kconfiglib 2 backup WIP --- tests/Klocation | 79 +++++++++++++-------------------------------------------- 1 file changed, 18 insertions(+), 61 deletions(-) (limited to 'tests/Klocation') diff --git a/tests/Klocation b/tests/Klocation index 404e5ae..498a372 100644 --- a/tests/Klocation +++ b/tests/Klocation @@ -1,73 +1,30 @@ -# Include some line continuations to make sure they don't mess up line numbers +if UNDEFINED +endif -# Defined and referenced in multiple locations -config A - bool +config SINGLE_DEF + +config MULTI_DEF # Throw in some line continuations too to make sure it doesn't mess up the line # numbers -menu "menu 1" - depends on A - visible if A && \ - NOT_DEFINED - -# Also defined in Klocation_included -choice B - bool "b" if A - -config C - bool "c" - -config D - bool "d" - -\ - -endchoice +if y && \ + y +if y && \ + y && \ + y -config A - def_bool NOT_DEFINED +config MULTI_DEF -comment "comment 1" +endif +endif -config E - bool "E" if A - depends on A - -endmenu - -config \ - FOO +config EXPANDED_FROM_ENV string - option \ - env\ - =\ - "FOO" - -\ -\ + option env="EXPANDED_FROM_ENV" -config BAR +config _INCLUDED string - default \ - "_included" + default "_included" # Expands to "tests/Klocation_included" -source \ -"$FOO/Klocation$BAR" - -\ -\ -\ - -config I - int - range A 0 - range 0 A - range 0 1 if A - default J if A < 0 - default K if 0 < A - default L if 0 <= A - default M if 0 > A - default N if 0 >= A - default N if y && 0 < A +source "$EXPANDED_FROM_ENV/Klocation$_INCLUDED" -- cgit v1.2.3 From 7bbaf7e7cf131d83931bfda2d2e8e5d6ef1b235f Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sat, 28 Oct 2017 05:46:25 +0200 Subject: Add uncommitted test files --- kconfiglib.py | 2 ++ tests/Khelp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ tests/Klocation | 2 ++ tests/Krepr | 2 +- tests/Kstr | 1 + tests/Kwtf | 8 ++++++++ 6 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 tests/Khelp create mode 100644 tests/Kwtf (limited to 'tests/Klocation') diff --git a/kconfiglib.py b/kconfiglib.py index 3262b43..1bf61a6 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -893,6 +893,8 @@ class Config(object): self._file = self._open(filename) except IOError as e: # Extend the error message a bit in this case + # TODO: broken for top-level Kconfig (because + # self._filename/_linenr isn't set) raise IOError( "{}:{}: {} Also note that e.g. $FOO in a 'source' " "statement does not refer to the environment " diff --git a/tests/Khelp b/tests/Khelp new file mode 100644 index 0000000..fdc81ed --- /dev/null +++ b/tests/Khelp @@ -0,0 +1,46 @@ +config TWO_HELP_STRINGS + help + first help string + + + + +config TWO_HELP_STRINGS + help + second help string + +config NO_BLANK_AFTER_HELP + help + help for + NO_BLANK_AFTER_HELP +choice CHOICE_HELP + help + help for + CHOICE_HELP +endchoice + +config HELP_TERMINATED_BY_COMMENT + bool + help + a + b + c +# + +config TRICKY_HELP + bool + help + + + a + b + c + + d + e + f + + + g + h + i diff --git a/tests/Klocation b/tests/Klocation index 498a372..737a221 100644 --- a/tests/Klocation +++ b/tests/Klocation @@ -28,3 +28,5 @@ config _INCLUDED # Expands to "tests/Klocation_included" source "$EXPANDED_FROM_ENV/Klocation$_INCLUDED" + +config MULTI_DEF diff --git a/tests/Krepr b/tests/Krepr index d886fe3..5a5b8b8 100644 --- a/tests/Krepr +++ b/tests/Krepr @@ -41,7 +41,7 @@ endchoice config CHOICE_HOOK choice - tristate "choice" if n + tristate "optional choice" if n optional endchoice diff --git a/tests/Kstr b/tests/Kstr index 8d74017..e591792 100644 --- a/tests/Kstr +++ b/tests/Kstr @@ -51,6 +51,7 @@ config INT range BAZ QAZ if DEP config MODULES + bool "MODULES" option modules config OPTIONS diff --git a/tests/Kwtf b/tests/Kwtf new file mode 100644 index 0000000..c71e328 --- /dev/null +++ b/tests/Kwtf @@ -0,0 +1,8 @@ +config A + bool + select n + select m + select y + imply n + imply m + imply y -- cgit v1.2.3