From 52745ee2f23470a9da73769f61847c8435eedd13 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Tue, 11 Dec 2012 11:49:55 +0100 Subject: Make get_defconfig_filename() selftest more comprehensive. --- kconfigtest.py | 8 +++++++- tests/Kdefconfig_existent_but_n | 13 +++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 tests/Kdefconfig_existent_but_n 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" -- cgit v1.2.3