Received: by 10.223.176.5 with SMTP id f5csp61403wra; Mon, 5 Feb 2018 16:42:13 -0800 (PST) X-Google-Smtp-Source: AH8x224/UPnaNCHtAce9xEp0eZnqSPaq9aOYcJksYvOg8BJdKnbZlj/FVpkR1jKd45dPAuq0hzbQ X-Received: by 10.99.109.4 with SMTP id i4mr472516pgc.376.1517877733626; Mon, 05 Feb 2018 16:42:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517877733; cv=none; d=google.com; s=arc-20160816; b=Zhe8P5BYlLHFmnYGyovmUTHDdVswT4fT3B83oaT+9zM4NGI2dgWVZu+jRu0UK4v3KW FWGDS8cMNarn+NC28JRRzPVQ2BiKzF4s/qlpJ5C+JEYcIEhl4ZFGOf9fiFYQi1O7EcOi IeOOH8c0vFH88hQlidQKM9fgzzPmeSWo1AqENKG7r2EBoJry/655ec9RtmgpEOd2kCAG 5SZBUYelFtAhEqv+0AtMkOUUVc++F/uLq8pafA7pWH8ilZlk32EkfhkFGuNqrUM4N0pv 4loxQF3y5OR7UWX/0e2RbU2zV4pVdvdcHe28paVos7OhH5Ehlx9nrE8YXIOh6ETN/vF5 kCZw== 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=UyG2oZNDTZKIRYq2fA34r4g+n0Fl50xMf4w/++5QxVI=; b=vrCdo+INa3gppsK0QAaT5XpGXFVXcjJp1e6Od1X/64ErmjwlTByvxt1iOlGquM+UBt DlbOltCsIgj6JObR3V9mrf/VbB9gMPaEDt6YT0LFmgwPdkrO4+DTJ7KQozcm3q2Xc78/ EIT/pIDkQIvSqb+3WXKrjo3b34cPuReh6ULju1G9ztchkSlvjBR9U1oOM80igI5cFGO7 Fl0XRnGPpb3ySTnSSbMEq21PbxvPqRwA59CMKUjd7N0rE2l5eqs6/ObuUWpCUf+L7Mow 8wLT3Dz4YECDaD0yH0W+YS1lttQsUD1BoedxZZeTVa/PeZhzwd9lFjFQVP42RDlAV3lR ZCxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=QXlow55/; 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 a7-v6si5854671pll.581.2018.02.05.16.41.56; Mon, 05 Feb 2018 16:42:13 -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=@nifty.com header.s=dec2015msa header.b=QXlow55/; 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 S1752716AbeBFAkd (ORCPT + 99 others); Mon, 5 Feb 2018 19:40:33 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:39806 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752277AbeBFAh4 (ORCPT ); Mon, 5 Feb 2018 19:37:56 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-07.nifty.com with ESMTP id w160ZHAp011351; Tue, 6 Feb 2018 09:35:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w160ZHAp011351 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1517877328; bh=UyG2oZNDTZKIRYq2fA34r4g+n0Fl50xMf4w/++5QxVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QXlow55/bNU0SDwxYCUprS1pACwWPXzRoyk6MfmFMlv9yPn0EhQ76juEY4aL2aMlg xSAs2M6maSioMeHaFXl6yW2BqzQPIFxDS4ct4vwi2P9LZQTtBKmiUMKBlqhxaAlOOh aE4lgE57VStm0TQy97+EbDMhf3Rn0Sh7qFzSqjJtM0goU6mXQwA79kN3mSfvEA9JHY VHFsqnxjx/4mUNl+AsQRif0Y33Y5MDE+LSrB02NKE015JtBef7oKa5t1KEcig1A6aY N3btngXYAjiCSAIpexxfLis9tlrBP1sHXwJTJV+43Vz/SOYjzB8YzdB3KzbtAkgLx9 csbvBDmZkCoYg== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Greg Kroah-Hartman , Andrew Morton , Nicolas Pitre , "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Michal Marek , Linus Torvalds , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 10/14] kconfig: test: check if new symbols in choice are asked Date: Tue, 6 Feb 2018 09:34:50 +0900 Message-Id: <1517877294-4826-11-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517877294-4826-1-git-send-email-yamada.masahiro@socionext.com> References: <1517877294-4826-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 --- 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