linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: linux-kbuild@vger.kernel.org
Cc: Ulf Magnusson <ulfalizer@gmail.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Taehee Yoo <ap420073@gmail.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] kconfig: tests: test reverse dependency with tristate if-conditional
Date: Mon, 26 Nov 2018 16:22:49 +0900	[thread overview]
Message-ID: <1543216969-2227-2-git-send-email-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <1543216969-2227-1-git-send-email-yamada.masahiro@socionext.com>

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


  reply	other threads:[~2018-11-26  7:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26  7:22 [PATCH 1/2] kconfig: fix reverse dependency with tristate if-conditional Masahiro Yamada
2018-11-26  7:22 ` Masahiro Yamada [this message]
2018-11-27  1:09   ` [PATCH 2/2] kconfig: tests: test " kbuild test robot
2018-11-26  8:15 ` [PATCH 1/2] kconfig: fix " kbuild test robot
2018-11-26  9:05   ` Masahiro Yamada
2018-11-26  8:37 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1543216969-2227-2-git-send-email-yamada.masahiro@socionext.com \
    --to=yamada.masahiro@socionext.com \
    --cc=ap420073@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=ulfalizer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).