summaryrefslogtreecommitdiff
path: root/tests/Kimply
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2017-10-01 20:01:08 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2017-10-02 00:07:51 +0200
commit1774239986d36f4894e7f59efd953f408cbbf80a (patch)
tree1da243ff8e8eda5d33f4b6d0f826639a94c51e06 /tests/Kimply
parent009ce631d0ba2978f51d15b0b250276a078707e8 (diff)
Make 'imply' consider direct dependencies
Bad oversight. Weak reverse dependencies (from imply) are not considered if the direct dependencies of a symbol are not met (the 'if'/'depends on' dependencies from the symbol and its parents, taking location into account if the symbol is defined in multiple places). Caused a wrong value for the symbol FS_FAT in the U-Boot Kconfigs, where 'imply' is more heavily used compared to the kernel. Add a new variable _direct_deps that corresponds to dir_dep from the C implementation. Before 'imply', dir_dep was only used for a 'select'-related warning in the C implementation. Add a bunch of tests to cover 'imply' semantics. Should be solid now.
Diffstat (limited to 'tests/Kimply')
-rw-r--r--tests/Kimply145
1 files changed, 145 insertions, 0 deletions
diff --git a/tests/Kimply b/tests/Kimply
new file mode 100644
index 0000000..3ce346f
--- /dev/null
+++ b/tests/Kimply
@@ -0,0 +1,145 @@
+config MODULES
+ def_bool y
+ option modules
+
+#
+# Implied symbols with unmet and met direct dependencies
+#
+
+config IMPLY_DIRECT_DEPS
+ def_tristate y
+ imply UNMET_DIRECT_1
+ imply UNMET_DIRECT_2
+ imply UNMET_DIRECT_3
+ imply MET_DIRECT_1
+ imply MET_DIRECT_2
+ imply MET_DIRECT_3
+ imply MET_DIRECT_4
+
+config UNMET_DIRECT_1
+ tristate
+ depends on n
+
+if n
+config UNMET_DIRECT_2
+ tristate
+endif
+
+menu "menu"
+ depends on n
+
+config UNMET_DIRECT_3
+ tristate
+
+endmenu
+
+config MET_DIRECT_1
+ tristate
+
+config MET_DIRECT_2
+ depends on y
+ tristate
+
+if y
+config MET_DIRECT_3
+ tristate
+endif
+
+menu "menu"
+ depends on y
+
+config MET_DIRECT_4
+ tristate
+
+endmenu
+
+#
+# 'imply' with condition
+#
+
+config IMPLY_COND
+ def_tristate y
+ tristate
+ imply IMPLIED_N_COND if n
+ imply IMPLIED_M_COND if m
+ imply IMPLIED_Y_COND if y
+
+config IMPLIED_N_COND
+ tristate
+
+config IMPLIED_M_COND
+ tristate
+
+config IMPLIED_Y_COND
+ tristate
+
+#
+# Implying from symbol with value n
+#
+
+# Will default to 'n'
+config IMPLY_N_1
+ tristate
+ imply IMPLIED_FROM_N_1
+
+# This test also disables the imply, so it's kinda redundant, but why not
+if n
+config IMPLY_N_2
+ tristate
+ imply IMPLIED_FROM_N_2
+endif
+
+config IMPLIED_FROM_N_1
+ tristate
+
+config IMPLIED_FROM_N_2
+ tristate
+
+#
+# Implying from symbol with value m
+#
+
+config IMPLY_M
+ def_tristate m
+ imply IMPLIED_M
+ # Implying a bool to 'm' makes it default to 'y'
+ imply IMPLIED_M_BOOL
+
+config IMPLIED_M
+ tristate
+
+config IMPLIED_M_BOOL
+ bool
+
+#
+# 'imply' which should raise an 'm' default to 'y'
+#
+
+config IMPLY_M_TO_Y
+ tristate
+ default y
+ imply IMPLIED_M_TO_Y
+
+config IMPLIED_M_TO_Y
+ tristate
+ default m
+
+#
+# Used for testing user values
+#
+
+config DIRECT_DEP
+ tristate "direct dep"
+
+config IMPLY
+ tristate "imply"
+ imply IMPLIED_TRISTATE
+ imply IMPLIED_BOOL
+
+config IMPLIED_TRISTATE
+ tristate "implied tristate"
+ depends on DIRECT_DEP
+
+config IMPLIED_BOOL
+ bool "implied bool"
+ depends on DIRECT_DEP