summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2012-12-11 11:49:55 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2012-12-11 11:49:55 +0100
commit52745ee2f23470a9da73769f61847c8435eedd13 (patch)
tree2328d2d3184c0b409de64958107718caac0ab5fc
parentf7cc4fbcc769b23dad05ad0b8d21ec650ac01037 (diff)
Make get_defconfig_filename() selftest more comprehensive.
-rw-r--r--kconfigtest.py8
-rw-r--r--tests/Kdefconfig_existent_but_n13
2 files changed, 20 insertions, 1 deletions
diff --git a/kconfigtest.py b/kconfigtest.py
index fc4bc94..088b456 100644
--- a/kconfigtest.py
+++ b/kconfigtest.py
@@ -490,8 +490,14 @@ def run_selftests():
"get_defconfig_filename() should be None when none of the files "
"in the defconfig_list symbol exist")
- # Referenced in Kdefconfig_existent
+ # Referenced in Kdefconfig_existent(_but_n)
os.environ["BAR"] = "defconfig_2"
+
+ c = kconfiglib.Config("Kconfiglib/tests/Kdefconfig_existent_but_n")
+ verify(c.get_defconfig_filename() is None,
+ "get_defconfig_filename() should be None when the condition is "
+ "n for all the defaults")
+
c = kconfiglib.Config("Kconfiglib/tests/Kdefconfig_existent")
verify(c.get_defconfig_filename() == "Kconfiglib/tests/defconfig_2",
"get_defconfig_filename() should return the existent file "
diff --git a/tests/Kdefconfig_existent_but_n b/tests/Kdefconfig_existent_but_n
new file mode 100644
index 0000000..17b8980
--- /dev/null
+++ b/tests/Kdefconfig_existent_but_n
@@ -0,0 +1,13 @@
+# $FOO is "defconfig_2"
+# Should produce None due to the "depends on n"
+
+config FOO
+ option env="BAR"
+
+config A
+ string
+ depends on n
+ option defconfig_list
+ default "Kconfiglib/tests/defconfig_1" if y && !n && n
+ default "Kconfiglib/tests/$FOO"
+ default "Kconfiglib/tests/defconfig_1"