summaryrefslogtreecommitdiff
path: root/kconfigtest.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2012-12-06 19:26:50 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2012-12-06 19:27:52 +0100
commit2cd87dcf083f16177a984cad2ecff4710bde05d0 (patch)
treec956d3a538d05fb6e2ae2bb1dfbaa24d6d40e3c6 /kconfigtest.py
parent713b98b6f27cb82c36d677d0ea2ebdcd7bcf455f (diff)
Add tests for is_modifiable().
Introduce selftests with specific configurations provided by us.
Diffstat (limited to 'kconfigtest.py')
-rw-r--r--kconfigtest.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/kconfigtest.py b/kconfigtest.py
index edb14d4..adf2ce8 100644
--- a/kconfigtest.py
+++ b/kconfigtest.py
@@ -33,6 +33,40 @@ os.environ.pop("KCONFIG_ALLCONFIG", None)
nconfigs = 0
def run_tests():
+ run_selftests()
+ run_compatibility_tests()
+
+def run_selftests():
+ """Runs tests on specific configurations provided by us."""
+
+ print "Running selftests...\n"
+
+ print "Testing is_modifiable()..."
+ c = kconfiglib.Config("Kconfiglib/tests/Kmodifiable")
+ for s in (c["VISIBLE"],
+ c["TRISTATE_SELECTED_TO_M"],
+ c["VISIBLE_STRING"],
+ c["VISIBLE_INT"],
+ c["VISIBLE_HEX"]):
+ if not s.is_modifiable():
+ fail("{0} should be modifiable".format(s.get_name()))
+ for s in (c["NOT_VISIBLE"],
+ c["SELECTED_TO_Y"],
+ c["BOOL_SELECTED_TO_M"],
+ c["NOT_VISIBLE_STRING"],
+ c["NOT_VISIBLE_INT"],
+ c["NOT_VISIBLE_HEX"]):
+ if s.is_modifiable():
+ fail("{0} should not be modifiable".format(s.get_name()))
+
+ print
+
+def run_compatibility_tests():
+ """Runs tests on configurations from the kernel. Tests compability with the
+ C implementation by comparing outputs."""
+
+ print "Running compatibility tests...\n"
+
# The set of tests that want to run for all architectures in the kernel
# tree -- currently, all tests. The boolean flag indicates whether .config
# (generated by the C implementation) should be compared to ._config