Received: by 10.223.176.5 with SMTP id f5csp1270525wra; Wed, 7 Feb 2018 16:10:04 -0800 (PST) X-Google-Smtp-Source: AH8x22684rqe0zJnJfn+sCT5dGZfM9ufUtDkYjAOYodKRt5r1ifte5ts9dbFXg86DKhpfbCmkAzZ X-Received: by 10.98.60.5 with SMTP id j5mr7660734pfa.217.1518048604208; Wed, 07 Feb 2018 16:10:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518048604; cv=none; d=google.com; s=arc-20160816; b=v2TobM2638+p8TdxLD1icIqpYOSE5MnjWz/9fMKBpABxfrGb3CUD5uXckEqjM14tG1 56u7m9A9h86S7Nsv8e0j5K4a8DZrSBSpy7vd2Ez4xmXNu+Ilv06NfgJF4vl4tihjkNdB 0IZ9Qi81qf9Mo/j+q4oAi1IgpUHIbYMSaCFol9N19xvMElXQWnDgB7xZHtsQXxBO1Rw3 YxwJpK9clkBbiMdsw0TtPv1kIFnJcs+imoCmCChWqrQbCFTx5D7kxoGNrZxjq+eL0xdG YuN5l94h0/fXdB1YKbs1Jei251AP1ep2tJ2RQHyxf3BNbvWGcSJoCKTAgzUvc5TOx1lq +ZEA== 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=v118VcUwLFs3DMgiDhxltFyw1kThWSYaahq7m5clhfY=; b=MDi8iop3GiSRiWeC025htj/rinyca08KRvh7otBBZMGv4FN0zkt4pzwEWUlw6mlGVH pYVdIqWys8ZN4STjfPeq0NiuJwbaXKiO0Brpi3cq0DRYnlBZZa8TWyjkYDYAIHCoAvSo UTCWRZUSTDMVlCUzseSgze8p4G+rGK2FNKhI+G96WOc2v5IinTCYtmqNRgVetOsji4k9 0SjCbG3s/kueCeLiZqFknJyjsqLEqvWCyuXMpha+rVMii1JJj/LxhngOTNVeDefuDhs8 SgjIDm/HRCV/Ku+kuOTotqJrZXpebczoCMiXVbcKa3nGxQuLuoZJWz/lT1FXuB69gfDp 8trg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XRWlg44X; 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 c14si1881070pfj.132.2018.02.07.16.09.49; Wed, 07 Feb 2018 16:10:04 -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=XRWlg44X; 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 S1751123AbeBHAJM (ORCPT + 99 others); Wed, 7 Feb 2018 19:09:12 -0500 Received: from mail-ua0-f196.google.com ([209.85.217.196]:41371 "EHLO mail-ua0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750736AbeBHAJK (ORCPT ); Wed, 7 Feb 2018 19:09:10 -0500 Received: by mail-ua0-f196.google.com with SMTP id f5so1773159ual.8; Wed, 07 Feb 2018 16:09:10 -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=v118VcUwLFs3DMgiDhxltFyw1kThWSYaahq7m5clhfY=; b=XRWlg44XLXgo+/9oHvTMZxfw8qgaRgho1bM4nYrudgiqQkgdiLPfMkjbEl6PIX5ImM rS7foe5dbNTf6CqRM1cJZB8R7zN/SFOdF5qgA2ZyDFa1Lk3VK2HXM1wkOE9IVW4fH4kH lXsP5/xIk2qqnujGuLvCRDIbk4Ab1MAZ9YRFTBA26mgmMJFfLJ11EBiFbvuoGbIiR7ST H5mGW/vFgmKPzJxi5RnFwOrC5BtB2X5wYalb05R8Ss7WBCL38SnL+LnwRM1v3rTkoyZ2 sqGUW/ykFykti4IvctgNQ9dIsDKrSK/obckdgvaMGtD3RqFBNhYfnx1+yGGgre37kpZe OgsQ== 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=v118VcUwLFs3DMgiDhxltFyw1kThWSYaahq7m5clhfY=; b=SiJ3dv9FPguQ+MXPpSvkSbdhBkw6qEo44YzaYcyZLcwMQAo9mCa/k1UIfCqsmTnVAU m/wBLogDCxW0owDcTykHeDHS66xev6E0n4/fVSjTfLPqgkq4V1YGc1gVvq2LbOoLlBBQ SQIiSxSXXE9GSLvz/k8JFlqOP7c5eRoNHF3W1IduGBYI1qP4tV0fPr8IShAmZUD30zSx fFHpfN8bm0uaVt8xN1Rhl2Z2wc5evHypP9fNcxUimd+zTVmrxNd2dFHlKrq1mEBJlnI1 nE9aItMn8ubyX9lWNhcSPANs9R04UmCZV2doBqMZS8oltLTTRKaDwlpZf8Wf4jndyQ1X kBow== X-Gm-Message-State: APf1xPAjxiWbT/tToMKsQo87A0oPYw/nMWZ3y7KG9fwLiZpstX48Vlob +0upHdW2rumaMSdiJ5QuyIMRPNNI4T/jseT/0F0= X-Received: by 10.159.36.247 with SMTP id 110mr6781270uar.77.1518048549599; Wed, 07 Feb 2018 16:09:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.70.21 with HTTP; Wed, 7 Feb 2018 16:09:09 -0800 (PST) In-Reply-To: <1517877294-4826-11-git-send-email-yamada.masahiro@socionext.com> References: <1517877294-4826-1-git-send-email-yamada.masahiro@socionext.com> <1517877294-4826-11-git-send-email-yamada.masahiro@socionext.com> From: Ulf Magnusson Date: Thu, 8 Feb 2018 01:09:09 +0100 Message-ID: Subject: Re: [PATCH 10/14] kconfig: test: check if new symbols in choice are asked 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 new choice values are added with new dependency, and they become > visible during user configuration, oldconfig should recognize them > as (NEW), and ask the user for choice. > > This issue was fixed by commit 5d09598d488f ("kconfig: fix new choices > being skipped upon config update"). > > This is a subtle corner case. Add a test case to avoid breakage. > > Signed-off-by: Masahiro Yamada > --- > > scripts/kconfig/tests/new_choice_with_dep/Kconfig | 37 ++++++++++++++++++++++ > .../kconfig/tests/new_choice_with_dep/__init__.py | 14 ++++++++ > scripts/kconfig/tests/new_choice_with_dep/config | 3 ++ > .../tests/new_choice_with_dep/expected_stdout | 10 ++++++ > 4 files changed, 64 insertions(+) > create mode 100644 scripts/kconfig/tests/new_choice_with_dep/Kconfig > create mode 100644 scripts/kconfig/tests/new_choice_with_dep/__init__.py > create mode 100644 scripts/kconfig/tests/new_choice_with_dep/config > create mode 100644 scripts/kconfig/tests/new_choice_with_dep/expected_stdout > > diff --git a/scripts/kconfig/tests/new_choice_with_dep/Kconfig b/scripts/kconfig/tests/new_choice_with_dep/Kconfig > new file mode 100644 > index 0000000..53ef1b8 > --- /dev/null > +++ b/scripts/kconfig/tests/new_choice_with_dep/Kconfig > @@ -0,0 +1,37 @@ > +config A > + bool "A" > + help > + This is a new symbol. > + > +choice > + prompt "Choice ?" > + depends on A > + help > + "depends on A" has been newly added. > + > +config CHOICE_B > + bool "Choice B" > + > +config CHOICE_C > + bool "Choice C" > + help > + This is a new symbol, so should be asked. > + > +endchoice > + > +choice > + prompt "Choice2 ?" > + > +config CHOICE_D > + bool "Choice D" > + > +config CHOICE_E > + bool "Choice E" > + > +config CHOICE_F > + bool "Choice F" > + depends on A > + help > + This is a new symbol, so should be asked. > + > +endchoice > diff --git a/scripts/kconfig/tests/new_choice_with_dep/__init__.py b/scripts/kconfig/tests/new_choice_with_dep/__init__.py > new file mode 100644 > index 0000000..4306ccf > --- /dev/null > +++ b/scripts/kconfig/tests/new_choice_with_dep/__init__.py > @@ -0,0 +1,14 @@ > +""" > +Ask new choice values when they become visible > +============================================== > + > +If new choice values are added with new dependency, and they become > +visible during user configuration, oldconfig should recognize them > +as (NEW), and ask the user for choice. > + > +Related Linux commit: 5d09598d488f081e3be23f885ed65cbbe2d073b5 > +""" > + > +def test(conf): > + assert conf.oldconfig('config', 'y') == 0 > + assert conf.stdout_contains('expected_stdout') > diff --git a/scripts/kconfig/tests/new_choice_with_dep/config b/scripts/kconfig/tests/new_choice_with_dep/config > new file mode 100644 > index 0000000..47ef95d > --- /dev/null > +++ b/scripts/kconfig/tests/new_choice_with_dep/config > @@ -0,0 +1,3 @@ > +CONFIG_CHOICE_B=y > +# CONFIG_CHOICE_D is not set > +CONFIG_CHOICE_E=y > diff --git a/scripts/kconfig/tests/new_choice_with_dep/expected_stdout b/scripts/kconfig/tests/new_choice_with_dep/expected_stdout > new file mode 100644 > index 0000000..358d5cf > --- /dev/null > +++ b/scripts/kconfig/tests/new_choice_with_dep/expected_stdout > @@ -0,0 +1,10 @@ > +A (A) [N/y/?] (NEW) > + Choice ? > + > 1. Choice B (CHOICE_B) > + 2. Choice C (CHOICE_C) (NEW) > + choice[1-2?]: > +Choice2 ? > + 1. Choice D (CHOICE_D) > +> 2. Choice E (CHOICE_E) > + 3. Choice F (CHOICE_F) (NEW) > +choice[1-3?]: > -- > 2.7.4 > Reviewed-by: Ulf Magnusson