Received: by 10.223.176.5 with SMTP id f5csp1273750wra; Wed, 7 Feb 2018 16:14:12 -0800 (PST) X-Google-Smtp-Source: AH8x227IUDFeJvBMC+fyF5OXC6EW5etkQv6XrbrsGC7bA/Gk48Q3bORR6Lc8I5eheXpO2FE4Xg+1 X-Received: by 2002:a17:902:7e0e:: with SMTP id b14-v6mr7545660plm.97.1518048852735; Wed, 07 Feb 2018 16:14:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518048852; cv=none; d=google.com; s=arc-20160816; b=zgQb7yyXKZfZ9+mZtvvDLfMjD6ck/fZmlErVYXkmj/uDhVjLStg8YKe/cBUiU9nwX0 qybL2vLfJbMxi0ljzugeM1iLekaKS6MOiQve9wXXTJkOU05ZcLtWOb0lBYzBtx0S3aOY +dgGeKnkPfARh7/E5Nk0iwLLm55YAm4qer0q3UaAt6G8FKrERLqkQh5gmuBfe/UMidRg OEqqoU/tkxZdyaDL+67Uu8z1eDL5B5WMI7QKkQrJI01me8TT5YnXxHu0of1jxZGUHwsb /asGy4SnoiuMj9/L7z8LBoMGFXRRE/GNJFul4YTyG+OmNIZEXt7BPcOt7go9C0gXCWZC hBEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=uKYPfMLg5qoP1hzpX+0VN7FAJmDPWhR77BqqBtO6uZ4=; b=ojG/Pb/6AydlKoDyOIHq16AmppzaN4XMsEGxgGoT/L+RefkkS3s6CE6XUPQZaxktYG d3oCmX74Txm+j29uNcvuqa9ozhzZ+vzf7xmx/hSbdzyDd3Cy02Z/agF4UvRhtGmKHvHy YA2edMyMwktHg4BnOGquhpA9+NFi6ktPD98SSCWK39KFoLO4fexdPmEm+tx65Gl8BoQN CDPsxxhTR/Ct4k1yuXaLJZLpywlow73A1cnKgXweHBVqIturejsgy+wHLOXk/5L56A7q 6df8FkwMNp8a3/1P8XhOS8uSUuC5pZPWrlZ5zvO3E7aaPcFmIsPEqtO/gLw5qhlX4UAs Q3HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XWEMJiHE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s11-v6si1853005plj.318.2018.02.07.16.13.58; Wed, 07 Feb 2018 16:14:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XWEMJiHE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751075AbeBHANM (ORCPT + 99 others); Wed, 7 Feb 2018 19:13:12 -0500 Received: from mail-vk0-f68.google.com ([209.85.213.68]:33507 "EHLO mail-vk0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750729AbeBHANK (ORCPT ); Wed, 7 Feb 2018 19:13:10 -0500 Received: by mail-vk0-f68.google.com with SMTP id w201so1730798vkw.0; Wed, 07 Feb 2018 16:13:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uKYPfMLg5qoP1hzpX+0VN7FAJmDPWhR77BqqBtO6uZ4=; b=XWEMJiHExnoXZcY9EBMhlocmlI/tN5nePAINgUAqIRW3Jpmll8c6vlWqgewZV7pid1 nDI89E6E6M76qR2Jk/6HF8xm8N9DhuSYzNk01swHVGuZr+RZcIbVwUs3HHtU+UMzvOZw BhlF+SwuCIAgrKxwtIwohR63maNsx8NrbwgbTJTmo/OlyOf3LZZ83MdUydWkueSAAlXR idFSGg749nAnNUd4z60PpNi+TWtfrBWLGYP8HNSTDuVJC/i/VeB+Xxeei7gRr+1LN4GE QGW666a7brm8WPQgP61h4PSZKtmxwCZKQp3bUFtX/g+q04i+wtNHosojabBbPfiedZYu Ze+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uKYPfMLg5qoP1hzpX+0VN7FAJmDPWhR77BqqBtO6uZ4=; b=jTvZIN5txuluupTIpCugLbga+V6fll1XfN6OU0mS8fGMEhAcpQ00EV9pdT8ANf9WLo 9gqKq+83xw/OGeVbOXpzVbmP86tqi+bnhrJe/BQpYai8NghO72neGVxYDLHaYa3AaL2Q JjT5307zFbpBW9gWMxl6mF+Py3t8xh/uplyoTWaxEjHRE7nc/DKhrVgh2blxxmpFWm/L d9dE/GhveXpFObDW+HE+rSQcpP/33JqWwt2bkuzhoC769qNEaD7v3i9L63EN+vmRDi3n POYtTZL13F9IVSP0Sl12wIxXiHq8hmD5aInuk6b4CzbqTy701aohTK3w8iDfslFioRPe aFkQ== X-Gm-Message-State: APf1xPD9kO+1lL2VlaufvnOL+nDno+zw93gcS0rQdl32OEOarEELk8Pc +kaSWTnFIXGZy40dRzgXER5+MpQyP1ZOgDV3/6WvAj+5crQ= X-Received: by 10.31.181.69 with SMTP id e66mr6544934vkf.122.1518048789546; Wed, 07 Feb 2018 16:13:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.70.21 with HTTP; Wed, 7 Feb 2018 16:13:09 -0800 (PST) In-Reply-To: <1517877294-4826-13-git-send-email-yamada.masahiro@socionext.com> References: <1517877294-4826-1-git-send-email-yamada.masahiro@socionext.com> <1517877294-4826-13-git-send-email-yamada.masahiro@socionext.com> From: Ulf Magnusson Date: Thu, 8 Feb 2018 01:13:09 +0100 Message-ID: Subject: Re: [PATCH 12/14] kconfig: test: check visibility of tristate choice values in y choice To: Masahiro Yamada Cc: Linux Kbuild mailing list , Greg Kroah-Hartman , Andrew Morton , Nicolas Pitre , "Luis R . Rodriguez" , Randy Dunlap , Sam Ravnborg , Michal Marek , Linus Torvalds , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 6, 2018 at 1:34 AM, Masahiro Yamada wrote: > If tristate choice values depend on symbols set to 'm', they should be > hidden when the choice containing them is changed from 'm' to 'y' > (i.e. exclusive choice). > > This issue was fixed by commit fa64e5f6a35e ("kconfig/symbol.c: handle > choice_values that depend on 'm' symbols"). > > Add a test case to avoid regression. > > For the input in this unit test, there is a room for argument if > "# CONFIG_CHOICE1 is not set" should be written to the .config file. > > After commit fa64e5f6a35e, this line was written to the .config file. > > Then, it is not written after my fix "kconfig: do not write choice > values when their dependency becomes n". > > In this test, "# CONFIG_CHOICE1 is not set" is don't care. > > Signed-off-by: Masahiro Yamada > --- > > .../kconfig/tests/choice_value_with_m_dep/Kconfig | 20 ++++++++++++++++++++ > .../tests/choice_value_with_m_dep/__init__.py | 15 +++++++++++++++ > scripts/kconfig/tests/choice_value_with_m_dep/config | 2 ++ > .../tests/choice_value_with_m_dep/expected_config | 3 +++ > .../tests/choice_value_with_m_dep/expected_stdout | 4 ++++ > 5 files changed, 44 insertions(+) > create mode 100644 scripts/kconfig/tests/choice_value_with_m_dep/Kconfig > create mode 100644 scripts/kconfig/tests/choice_value_with_m_dep/__init__.py > create mode 100644 scripts/kconfig/tests/choice_value_with_m_dep/config > create mode 100644 scripts/kconfig/tests/choice_value_with_m_dep/expected_config > create mode 100644 scripts/kconfig/tests/choice_value_with_m_dep/expected_stdout > > diff --git a/scripts/kconfig/tests/choice_value_with_m_dep/Kconfig b/scripts/kconfig/tests/choice_value_with_m_dep/Kconfig > new file mode 100644 > index 0000000..dbc49e2 > --- /dev/null > +++ b/scripts/kconfig/tests/choice_value_with_m_dep/Kconfig > @@ -0,0 +1,20 @@ > +config MODULES > + bool > + default y > + option modules > + > +config DEP > + tristate > + default m > + > +choice > + prompt "Tristate Choice" > + > +config CHOICE0 > + tristate "Choice 0" > + > +config CHOICE1 > + tristate "Choice 1" > + depends on DEP > + > +endchoice > diff --git a/scripts/kconfig/tests/choice_value_with_m_dep/__init__.py b/scripts/kconfig/tests/choice_value_with_m_dep/__init__.py > new file mode 100644 > index 0000000..ec71777 > --- /dev/null > +++ b/scripts/kconfig/tests/choice_value_with_m_dep/__init__.py > @@ -0,0 +1,15 @@ > +""" > +Hide tristate choice values with mod dependency in y choice > +=========================================================== > + > +If tristate choice values depend on symbols set to 'm', they should be > +hidden when the choice containing them is changed from 'm' to 'y' > +(i.e. exclusive choice). > + > +Related Linux commit: fa64e5f6a35efd5e77d639125d973077ca506074 > +""" > + > +def test(conf): > + assert conf.oldaskconfig('config', 'y') == 0 > + assert conf.config_contains('expected_config') > + assert conf.stdout_contains('expected_stdout') > diff --git a/scripts/kconfig/tests/choice_value_with_m_dep/config b/scripts/kconfig/tests/choice_value_with_m_dep/config > new file mode 100644 > index 0000000..3a126b7 > --- /dev/null > +++ b/scripts/kconfig/tests/choice_value_with_m_dep/config > @@ -0,0 +1,2 @@ > +CONFIG_CHOICE0=m > +CONFIG_CHOICE1=m > diff --git a/scripts/kconfig/tests/choice_value_with_m_dep/expected_config b/scripts/kconfig/tests/choice_value_with_m_dep/expected_config > new file mode 100644 > index 0000000..4d07b44 > --- /dev/null > +++ b/scripts/kconfig/tests/choice_value_with_m_dep/expected_config > @@ -0,0 +1,3 @@ > +CONFIG_MODULES=y > +CONFIG_DEP=m > +CONFIG_CHOICE0=y > diff --git a/scripts/kconfig/tests/choice_value_with_m_dep/expected_stdout b/scripts/kconfig/tests/choice_value_with_m_dep/expected_stdout > new file mode 100644 > index 0000000..5eac85d > --- /dev/null > +++ b/scripts/kconfig/tests/choice_value_with_m_dep/expected_stdout > @@ -0,0 +1,4 @@ > +Tristate Choice [M/y/?] > +Tristate Choice > +> 1. Choice 0 (CHOICE0) > +choice[1]: 1 > -- > 2.7.4 > Reviewed-by: Ulf Magnusson