lkml.org 
[lkml]   [2018]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] kconfig: tests: test reverse dependency with tristate if-conditional
Date
Add a test-case for the fixed reverse dependency handling.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

.../kconfig/tests/revdep_with_tristate_if/Kconfig | 21 +++++++++++++++++++++
.../tests/revdep_with_tristate_if/__init__.py | 14 ++++++++++++++
.../tests/revdep_with_tristate_if/expected_config | 9 +++++++++
3 files changed, 44 insertions(+)
create mode 100644 scripts/kconfig/tests/revdep_with_tristate_if/Kconfig
create mode 100644 scripts/kconfig/tests/revdep_with_tristate_if/__init__.py
create mode 100644 scripts/kconfig/tests/revdep_with_tristate_if/expected_config

diff --git a/scripts/kconfig/tests/revdep_with_tristate_if/Kconfig b/scripts/kconfig/tests/revdep_with_tristate_if/Kconfig
new file mode 100644
index 0000000..2bd1141
--- /dev/null
+++ b/scripts/kconfig/tests/revdep_with_tristate_if/Kconfig
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: GPL-2.0
+
+config MODULES
+ def_bool y
+ option modules
+
+config A
+ tristate
+
+config B
+ tristate "b"
+ default y
+ select A if C
+ imply D if C
+
+config C
+ tristate "c"
+ default m
+
+config D
+ tristate "d"
diff --git a/scripts/kconfig/tests/revdep_with_tristate_if/__init__.py b/scripts/kconfig/tests/revdep_with_tristate_if/__init__.py
new file mode 100644
index 0000000..ad95cec
--- /dev/null
+++ b/scripts/kconfig/tests/revdep_with_tristate_if/__init__.py
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0
+"""
+select/imply property with tristate if-conditional
+
+The reverse dependencies (select/imply) are used to define a lower limit
+of another symbol. The current value of the selector is set to the lower
+limit of the selectee. This did not handled correctly in the past when the
+property has a tristate if-conditional.
+"""
+
+
+def test(conf):
+ assert conf.alldefconfig() == 0
+ assert conf.config_matches('expected_config')
diff --git a/scripts/kconfig/tests/revdep_with_tristate_if/expected_config b/scripts/kconfig/tests/revdep_with_tristate_if/expected_config
new file mode 100644
index 0000000..9826223
--- /dev/null
+++ b/scripts/kconfig/tests/revdep_with_tristate_if/expected_config
@@ -0,0 +1,9 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Main menu
+#
+CONFIG_MODULES=y
+CONFIG_A=y
+CONFIG_B=y
+CONFIG_C=m
+CONFIG_D=y
--
2.7.4
\
 
 \ /
  Last update: 2018-11-26 08:25    [W:0.110 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site