summaryrefslogtreecommitdiff
path: root/kconfigtest.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2012-12-11 05:16:18 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2012-12-11 05:16:36 +0100
commitde7f4f321bdb6011ad233d8471b792d5602f11e0 (patch)
tree5cdf069d4ef7b77dbc9d9b126d7f6a146b95c967 /kconfigtest.py
parent129513fb8ed095533a2c56adbec1ac7b268f646e (diff)
Use verify() instead of if + fail() in more locations.
Also be clearer about test results.
Diffstat (limited to 'kconfigtest.py')
-rw-r--r--kconfigtest.py42
1 files changed, 21 insertions, 21 deletions
diff --git a/kconfigtest.py b/kconfigtest.py
index 6bf7a69..37a1a2a 100644
--- a/kconfigtest.py
+++ b/kconfigtest.py
@@ -511,7 +511,7 @@ def run_compatibility_tests():
print ""
if all_ok():
- print "All OK"
+ print "All selftests and compatibility tests passed"
print nconfigs, "arch/defconfig pairs tested"
else:
print "Some tests failed"
@@ -614,8 +614,8 @@ def test_call_all(conf):
except kconfiglib.Kconfig_Syntax_Error:
caught_exception = True
- if not caught_exception:
- fail("No exception generated for expression with syntax error")
+ verify(caught_exception,
+ "No exception generated for expression with syntax error")
conf.get_config_header()
conf.get_base_dir()
@@ -647,32 +647,32 @@ def test_call_all(conf):
if s.is_from_environment():
# Special symbols from the environment should have define
# locations
- if s.get_def_locations() == []:
- fail("The symbol '{0}' is from the environment but "
- "lacks define locations".format(s.get_name()))
+ verify(s.get_def_locations() != [],
+ "The symbol '{0}' is from the environment but lacks "
+ "define locations".format(s.get_name()))
else:
# Special symbols that are not from the environment should be
# defined and have no define locations
- if not s.is_defined():
- fail("The special symbol '{0}' is not defined".
- format(s.get_name()))
- if not s.get_def_locations() == []:
- fail("The special symbol '{0}' has recorded def. "
- "locations".format(s.get_name()))
+ verify(s.is_defined(),
+ "The special symbol '{0}' is not defined".
+ format(s.get_name()))
+ verify(s.get_def_locations() == [],
+ "The special symbol '{0}' has recorded def. locations".
+ format(s.get_name()))
else:
# Non-special symbols should have define locations iff they are
# defined
if s.is_defined():
- if s.get_def_locations() == []:
- fail("'{0}' defined but lacks recorded locations".
- format(s.get_name()))
+ verify(s.get_def_locations() != [],
+ "'{0}' defined but lacks recorded locations".
+ format(s.get_name()))
else:
- if s.get_def_locations() != []:
- fail("'{0}' undefined but has recorded locations".
- format(s.get_name()))
- if s.get_ref_locations() == []:
- fail("'{0}' both undefined and unreferenced".
- format(s.get_name()))
+ verify(s.get_def_locations() == [],
+ "'{0}' undefined but has recorded locations".
+ format(s.get_name()))
+ verify(s.get_ref_locations() != [],
+ "'{0}' both undefined and unreferenced".
+ format(s.get_name()))
s.get_ref_locations()
s.is_modifiable()