summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/allnoconfig_simpler.py22
-rw-r--r--examples/allnoconfig_walk.py (renamed from examples/allnoconfig.py)12
-rw-r--r--testsuite.py16
3 files changed, 13 insertions, 37 deletions
diff --git a/examples/allnoconfig_simpler.py b/examples/allnoconfig_simpler.py
deleted file mode 100644
index 3babcab..0000000
--- a/examples/allnoconfig_simpler.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# This is a simpler version of allnoconfig.py, corresponding to how the C
-# implementation does it. Verified by the test suite to produce identical
-# output to 'make allnoconfig' for all ARCHes.
-#
-# Usage:
-#
-# $ make [ARCH=<arch>] scriptconfig SCRIPT=Kconfiglib/examples/allnoconfig_simpler.py
-
-from kconfiglib import Kconfig, BOOL, TRISTATE
-import sys
-
-kconf = Kconfig(sys.argv[1])
-
-# Avoid warnings printed by Kconfiglib when assigning a value to a symbol that
-# has no prompt. Such assignments never have an effect.
-kconf.disable_warnings()
-
-for sym in kconf.defined_syms:
- if sym.type in (BOOL, TRISTATE):
- sym.set_value(2 if sym.is_allnoconfig_y else 0)
-
-kconf.write_config(".config")
diff --git a/examples/allnoconfig.py b/examples/allnoconfig_walk.py
index e7f05f4..8e22cd9 100644
--- a/examples/allnoconfig.py
+++ b/examples/allnoconfig_walk.py
@@ -1,12 +1,10 @@
-# Works like 'make allnoconfig'. Verified by the test suite to generate
-# identical output to 'make allnoconfig' for all ARCHes.
+# This is tree-walking version of allnoconfig.py, for demonstration purposes.
+# Verified by the test suite to generate identical output to 'make allnoconfig'
+# for all ARCHes.
#
-# See allnoconfig_simpler.py for a much simpler version. This more roundabout
-# version demonstrates some tree walking and value processing.
+# Usage for the Linux kernel:
#
-# Usage:
-#
-# $ make [ARCH=<arch>] scriptconfig SCRIPT=Kconfiglib/examples/allnoconfig.py
+# $ make [ARCH=<arch>] scriptconfig SCRIPT=Kconfiglib/examples/allnoconfig_walk.py
from kconfiglib import Kconfig, Symbol
import sys
diff --git a/testsuite.py b/testsuite.py
index f157797..29d5860 100644
--- a/testsuite.py
+++ b/testsuite.py
@@ -1903,7 +1903,7 @@ def run_compatibility_tests():
#test_min_config,
test_sanity,
test_all_no,
- test_all_no_simpler,
+ test_all_no_walk,
test_all_yes)
for test_fn in test_fns:
@@ -1947,12 +1947,12 @@ def all_arch_srcarch_kconfigs():
def test_all_no(conf, arch, srcarch):
"""
- Verify that our examples/allnoconfig.py script generates the same .config
- as 'make allnoconfig', for each architecture. Runs the script via
- 'make scriptconfig', so kinda slow even in speedy mode.
+ Verify that allnoconfig.py script generates the same .config as 'make
+ allnoconfig', for each architecture. Runs the script via 'make
+ scriptconfig', so kinda slow even in speedy mode.
"""
# TODO: Support speedy mode for running the script
- shell("make scriptconfig SCRIPT=Kconfiglib/examples/allnoconfig.py "
+ shell("make scriptconfig SCRIPT=Kconfiglib/allnoconfig.py "
"PYTHONCMD='{}'".format(sys.executable))
shell("mv .config ._config")
if speedy:
@@ -1962,14 +1962,14 @@ def test_all_no(conf, arch, srcarch):
compare_configs(arch)
-def test_all_no_simpler(conf, arch, srcarch):
+def test_all_no_walk(conf, arch, srcarch):
"""
- Verify that our examples/allnoconfig_simpler.py script generates the same
+ Verify that our examples/allnoconfig_walk.py script generates the same
.config as 'make allnoconfig', for each architecture. Runs the script via
'make scriptconfig', so kinda slow even in speedy mode.
"""
# TODO: Support speedy mode for running the script
- shell("make scriptconfig SCRIPT=Kconfiglib/examples/allnoconfig_simpler.py "
+ shell("make scriptconfig SCRIPT=Kconfiglib/examples/allnoconfig_walk.py "
"PYTHONCMD='{}'".format(sys.executable))
shell("mv .config ._config")
if speedy: