Received: by 10.223.176.5 with SMTP id f5csp1272181wra; Wed, 7 Feb 2018 16:12:09 -0800 (PST) X-Google-Smtp-Source: AH8x227k5HW3UGIN2HqybJSL2kQQBMBQ0zlH4XxfUhkmnDyW65WD0fMFVdo78EwYSen06+0F4TE3 X-Received: by 10.99.149.4 with SMTP id p4mr4939524pgd.0.1518048729581; Wed, 07 Feb 2018 16:12:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518048729; cv=none; d=google.com; s=arc-20160816; b=Ec7OysBQySx59KIJ3+ygjjCWwDUqqKA5gM9pTq821r7sWj/EglzVbfNdM6f0e03nae +ZqFiRYTZGweMSE02gKER+W1GmtLk/6a46+6rBxUdUjyRKomQ3kItdQw9BH2s4p0VgZF CRQNCy5c9mJTcHgy/IojtkOcOLLXYa3ikjk11UT+/LDedlv8PQnWMR26v+lzHwdF2obf tITrhan2PhAWZ5WDkR+Ng2g9rQMen7lbPQxvGU3Mym22hGJvIrbgFAbCUm8W0zB+BKv1 QDQ+FuBzWHronoDX0ZNaw3nzziHh/TJTl/I8WtrQADPcBv6sQCmfLC4yVNCezRePj4LZ qAMg== 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=aFdy+HeSNF1riVMJLvJuxFTengPfyrWMy7/Am5rV/Q4=; b=gMWS4kAWNskYeopyQmCE0YdkR1ub5+qvXQrxC0db+Zh1sxBBqF9JZlJCifLybaMOaV bhNgoGLtH/h5gfpmNoB2g0ZPNTIhiZxvTJZBUOsCaSHqQdzhD6TdbW4YWd/OZqMl01pK L0AtU0S1mw4lY3QPH2g5ALrbMLPD7z/4G6NjGQlHlYPBrYyutmaufyyspltNOIu2klU+ 9gczplsVaMgWCpf3RKg1yhrKPwcVCstTZzlI9ST8iMKLxxiNzryy+mUCTINxye8/ZRvA Nde2NV4zePGTGgB+WWF6mpVf6NnFPr7DjPwN/pO45rGG7CwL1A+vjAT2VY8MjM3e3HzI ZJXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KCc5QlWo; 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 h185si569846pfe.94.2018.02.07.16.11.55; Wed, 07 Feb 2018 16:12:09 -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=KCc5QlWo; 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 S1751632AbeBHALH (ORCPT + 99 others); Wed, 7 Feb 2018 19:11:07 -0500 Received: from mail-vk0-f66.google.com ([209.85.213.66]:37733 "EHLO mail-vk0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751123AbeBHALE (ORCPT ); Wed, 7 Feb 2018 19:11:04 -0500 Received: by mail-vk0-f66.google.com with SMTP id g83so1723455vki.4; Wed, 07 Feb 2018 16:11:03 -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=aFdy+HeSNF1riVMJLvJuxFTengPfyrWMy7/Am5rV/Q4=; b=KCc5QlWoXsBUfYZOYCWM5/icH3wMSurxZ8ANvrqD5UaQ6NMRBw39drhHlyMoO37gKz UA1/OAtvc71LNEY9/M2yMzhwnsiGXXhFQQAXOkEU899w3fOH/96KO7kFiOsosvpfdqeR mH+E4eH5cc2SFZ2vleiL2GqPQsIuIifTYOsn/zHOOYHpSLUSMk5aAOQ17884eJ1e7C+x CkJ8rc5RMgv4SSmspKYv5z1DKXwvUrgAnkcooabvDVhoNAMIRM2ojpTgjPdhAmg5rijp U1Zf+JDYf6uQ4ntFxOsx/grrlz0zAtRVbzarwA2vwib45KMI9G3/68SsjXxe4HgRd/0r 1pHw== 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=aFdy+HeSNF1riVMJLvJuxFTengPfyrWMy7/Am5rV/Q4=; b=rrLojjgXlMcrMuPh81MbHEr1El0DPjoydoqpvauOQtIEndaijyaDuxFKoUxZYUqNH0 xZDIXiHSZXCidC8W5erK2Tf5qD0PP9kn6agP7U/Zls3A+mFfZd5Hm+qEKe4so9xh48F9 wX20lgXc8sIs+swc5nYyI5cOdEN3I3Hdx7LGsAF69gFCbclQHjNr4uw5HUiBeWRlcSga TzlrkIU9dMfJLWJy3Q8IgP4lTvN1Ogtj+bf5ZSKebOGDZAKe/1dOUWzuGmmwKDRUybt5 L7SFiMUbd5ar0nYiFtoweU7agack428lAJdRGF18/z28IuyywA98b2ydH+OlQes69M5E hQ2A== X-Gm-Message-State: APf1xPAbDOjYs6j/fvvuOr9xnpGKW0F37ZonvdHsjiYoVCgedz2lGmtb mIYgZ28babigcufg2aJDrBdWjDEBWzL7+hjOOAI= X-Received: by 10.31.15.149 with SMTP id 143mr6503842vkp.126.1518048663255; Wed, 07 Feb 2018 16:11:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.70.21 with HTTP; Wed, 7 Feb 2018 16:11:02 -0800 (PST) In-Reply-To: <1517877294-4826-12-git-send-email-yamada.masahiro@socionext.com> References: <1517877294-4826-1-git-send-email-yamada.masahiro@socionext.com> <1517877294-4826-12-git-send-email-yamada.masahiro@socionext.com> From: Ulf Magnusson Date: Thu, 8 Feb 2018 01:11:02 +0100 Message-ID: Subject: Re: [PATCH 11/14] kconfig: test: check .config sanity for choice values with unmet dep 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: > I fixed a problem where "# CONFIG_..." for choice values are wrongly > written into the .config file when they are once visible, then become > invisible later. > > Add a test for this subtle case. > > Signed-off-by: Masahiro Yamada > --- > > scripts/kconfig/tests/no_write_if_dep_unmet/Kconfig | 14 ++++++++++++++ > scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py | 17 +++++++++++++++++ > scripts/kconfig/tests/no_write_if_dep_unmet/config | 1 + > .../kconfig/tests/no_write_if_dep_unmet/expected_config | 5 +++++ > 4 files changed, 37 insertions(+) > create mode 100644 scripts/kconfig/tests/no_write_if_dep_unmet/Kconfig > create mode 100644 scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py > create mode 100644 scripts/kconfig/tests/no_write_if_dep_unmet/config > create mode 100644 scripts/kconfig/tests/no_write_if_dep_unmet/expected_config > > diff --git a/scripts/kconfig/tests/no_write_if_dep_unmet/Kconfig b/scripts/kconfig/tests/no_write_if_dep_unmet/Kconfig > new file mode 100644 > index 0000000..c00b8fe > --- /dev/null > +++ b/scripts/kconfig/tests/no_write_if_dep_unmet/Kconfig > @@ -0,0 +1,14 @@ > +config A > + bool "A" > + > +choice > + prompt "Choice ?" > + depends on A > + > +config CHOICE_B > + bool "Choice B" > + > +config CHOICE_C > + bool "Choice C" > + > +endchoice > diff --git a/scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py b/scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py > new file mode 100644 > index 0000000..d096622 > --- /dev/null > +++ b/scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py > @@ -0,0 +1,17 @@ > +""" > +Do not write choice values to .config if the dependency is unmet > +================================================================ > + > +"# CONFIG_... is not set" should not be written into the .config file > +for symbols with unmet dependency. > + > +This was not working correctly for choice values because choice needs > +a bit different symbol computation. > + > +This checks that no unneeded "# COFIG_... is not set" is contained in > +the .config file. > +""" > + > +def test(conf): > + assert conf.oldaskconfig('config', 'n') == 0 > + assert conf.config_matches('expected_config') > diff --git a/scripts/kconfig/tests/no_write_if_dep_unmet/config b/scripts/kconfig/tests/no_write_if_dep_unmet/config > new file mode 100644 > index 0000000..abd280e > --- /dev/null > +++ b/scripts/kconfig/tests/no_write_if_dep_unmet/config > @@ -0,0 +1 @@ > +CONFIG_A=y > diff --git a/scripts/kconfig/tests/no_write_if_dep_unmet/expected_config b/scripts/kconfig/tests/no_write_if_dep_unmet/expected_config > new file mode 100644 > index 0000000..0d15e41 > --- /dev/null > +++ b/scripts/kconfig/tests/no_write_if_dep_unmet/expected_config > @@ -0,0 +1,5 @@ > +# > +# Automatically generated file; DO NOT EDIT. > +# Linux Kernel Configuration > +# > +# CONFIG_A is not set > -- > 2.7.4 > Reviewed-by: Ulf Magnusson This indirectly tests that choices specified without a type get the type of the first choice value specified with a type too. Cheers, Ulf