summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2012-12-11 12:07:34 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2012-12-11 12:07:34 +0100
commit0eb086ab783048b84ce8e08f676c43a0542509ff (patch)
tree4f7a8d94b6c872c4d228c977ec4d2435a3ecf58d
parent52745ee2f23470a9da73769f61847c8435eedd13 (diff)
Add selftests for is_optional().
-rw-r--r--kconfigtest.py13
-rw-r--r--tests/Kmisc20
2 files changed, 33 insertions, 0 deletions
diff --git a/kconfigtest.py b/kconfigtest.py
index 088b456..0faafc5 100644
--- a/kconfigtest.py
+++ b/kconfigtest.py
@@ -504,6 +504,19 @@ def run_selftests():
"Kconfiglib/tests/defconfig_2")
#
+ # Misc. minor APIs
+ #
+
+ c = kconfiglib.Config("Kconfiglib/tests/Kmisc")
+
+ print "Testing is_optional()..."
+
+ verify(not c.get_choices()[0].is_optional(),
+ "First choice should not be optional")
+ verify(c.get_choices()[1].is_optional(),
+ "Second choice should be optional")
+
+ #
# Object dependencies
#
diff --git a/tests/Kmisc b/tests/Kmisc
new file mode 100644
index 0000000..1673896
--- /dev/null
+++ b/tests/Kmisc
@@ -0,0 +1,20 @@
+# For testing various minor APIs
+
+# is_optional()
+
+choice NOT_OPTIONAL
+ bool "not optional"
+config A
+ bool "A"
+config B
+ bool "B"
+endchoice
+
+choice OPTIONAL
+ tristate "optional"
+ optional
+config C
+ tristate "C"
+config D
+ tristate "D"
+endchoice