From patchwork Tue Mar 13 09:12:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131421 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp485465ljb; Tue, 13 Mar 2018 02:17:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELssCS6Jxxef4Qp7BUFNmPSOzQm9bgd+q36zT9AYqFG+nwuJpUYlkflFDhSyAg1lHoFHdG5/ X-Received: by 2002:a17:902:d20a:: with SMTP id t10-v6mr659185ply.123.1520932637257; Tue, 13 Mar 2018 02:17:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520932637; cv=none; d=google.com; s=arc-20160816; b=D8BfMf7bJZEIIAvJoKwcmdU3hPer2Lj4I1a+xpnke4qqGroF4YMDtITBmxbnr8elAo 6A2lPmp54jdK0Dl/1Sw4zxH0pyfHgarQbdVWzFW18mPFWzVYMi5q0sMMFFXBSMMKFRYC UwhgMNqb7LVpMAsinRVngnwGiAR6Sf5KAtyutb0hay8CMxU0Lh9ME+ZvKgnv1nnX2TnE hYj1qbFo0+KZXYftIo6skFyBc1kzNFB6hx30RbQdTBge9VTXeWY5UvBA42zzpJROhFq9 75Qt9C0U49c8MqkXBJqT7c3vahl5qGmV+/nYsn+++iaueSLJGSghnfGPLBfUWoqR5YnG u8tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=NBfDUTGshqF16/Fu4cko8hlBSaBEN8pk433MZY+9Ilw=; b=erBVijsMQ6f4HQngx/cNfSo3Jt1mAv9p0sIVuXy6JEaGxvxvj5MgBTtUEhNDSl0Edb CxstZ/rdMs0SU/B3N1pq+M2YDqOOorkAX6WSx2tI1ecGl5myZcCg1AW5kYhe5IUCsWvb kcX3SKI3wT+U3oJnPDo8/vnXlQMOULHHMLH8N776R8bHyS7CB1muVuuG1FRHQljA/+4z 90h1kDrIUkLJWmAfTbyC9rqYq/Vkp0vwHdqewOvRy/04fBQMkSB0JbyqrpLmgTbk4zhB uq0SrBD/gTKm3zEXfMTBPY1ucfoBRhHwDQMQxwSt2Q9h3Xq/+sZdZgKyLgUrXL5yel3o zbUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=N1nJ21bM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si6260368pgz.803.2018.03.13.02.17.16; Tue, 13 Mar 2018 02:17:17 -0700 (PDT) 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=@nifty.com header.s=dec2015msa header.b=N1nJ21bM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752435AbeCMJN6 (ORCPT + 28 others); Tue, 13 Mar 2018 05:13:58 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:41662 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752074AbeCMJN4 (ORCPT ); Tue, 13 Mar 2018 05:13:56 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id w2D9CIo6016505; Tue, 13 Mar 2018 18:12:22 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w2D9CIo6016505 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1520932343; bh=NBfDUTGshqF16/Fu4cko8hlBSaBEN8pk433MZY+9Ilw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N1nJ21bMFAKkY/xZA4UAsdvO1iNV+ajhiM0XaNakXssUzpgHR9VzC+jIUnxicPrUa noXHxb8dOkI9LhEWgTYA1ZNEGzGSDr2wJlzzmsq8eU4O8x0iwC9yrQwkZR6Dq+vnnv GjntpeD1zfCDNsFUY/MPIymGjnppCq3Qux/isjJq0zd0f0tweIeJ96A2bv1x8dmoUI QAJ0Mq59iLzeW0wug1BNRBnAb4Ktw0un+jy/F/WB06faOWMaXl4buBmSWsTAYVctmN 8JVAbMqFYL9vRXKVTHwhosUUmZtK3cCC8YuosoMCXgm91C5mqpj00cleQEMajbaikq xYfCXDbioQH9g== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Ulf Magnusson , Randy Dunlap , "Luis R . Rodriguez" , Tony Luck , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v3 05/11] kconfig: tests: test if new symbols in choice are asked Date: Tue, 13 Mar 2018 18:12:06 +0900 Message-Id: <1520932332-2449-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520932332-2449-1-git-send-email-yamada.masahiro@socionext.com> References: <1520932332-2449-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Ulf Magnusson --- Changes in v3: None Changes in v2: - coding style clean-up based on PEP8, PEP257 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 -- 2.7.4 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..f0e0ead --- /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..74dc0bc --- /dev/null +++ b/scripts/kconfig/tests/new_choice_with_dep/expected_stdout @@ -0,0 +1,10 @@ +A (A) [N/y/?] (NEW) y + 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?]: