Received: by 10.223.176.5 with SMTP id f5csp1261734wra; Wed, 7 Feb 2018 15:59:50 -0800 (PST) X-Google-Smtp-Source: AH8x225bBHvFgaTwi1ZmAcnr5Rdgxm0ppbXbzDOXa5nCASURDpiypwC5wHYy2FJKaYFTDMRYifa1 X-Received: by 10.99.116.19 with SMTP id p19mr6329163pgc.49.1518047990325; Wed, 07 Feb 2018 15:59:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518047990; cv=none; d=google.com; s=arc-20160816; b=vW/vMoTzGNWlg5dHi4zhZAonIM9Gzn0ZYPNe15z3Xf4zvfVyAMCaG7/OQ4+GsHrLQp HE440UTDf7hMOfmWATfArvX+/DxbJYHxrkZqwplMj5eVD0qFV5sIYlh0cR+CURqkxXEN S5kz8af7AZVfl5mfUrAQ1woK4rN7jq7Btkvr8xfnwjBZVsLpU6IKQubr2iMhTDOKDzqn H/O+J8mjnzmaZRJWGE4917s5orNUxkIYEwDQQcEHnqRh++hzdiWCzkehKmM1rxzke17U mu/+6G9RsFvO4fUewRknfNQ//R7/mQnHGJZmui+4vGa1H+jDzr5j1VCOhhKmkMb1c3XC JGPA== 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=ywtqmartQEunV9fbWF/KXCB7DPt00XLuf9ZvvJwsGcc=; b=wnpkVd7aFEaTkbkCuuVNuaial54LN/BTHdFUL9X2AzvHaAgALzkDFAFbVIeAmpjOYb 7iZevCLLzXPT7jW4lUuZbyiu7aCrsxq56RQ+gPkcsHWN+pQ+EjAADrjyo9CD5iCioY8K fZxnHC9hRzCY8cxgQ55QVhiBFGMn684fkO5pCjXv8t6B9lfQARdHtzIousZ1qM9ek1Ho np/YbESkOPweUB6J/a3koxztB68yGhht0Uq1N6P8GRO4DreyEllldV98MTwcQbdBtJxG 97PzmaOoJO247OgtssCM421L+YIE3KWx43Ks5v0qJiYQq7lYVG4MaMCFUysljmhRlm3t bZZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=s6Xsmpm0; 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 n16-v6si1844657pll.349.2018.02.07.15.59.36; Wed, 07 Feb 2018 15:59:50 -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=s6Xsmpm0; 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 S1751671AbeBGX7B (ORCPT + 99 others); Wed, 7 Feb 2018 18:59:01 -0500 Received: from mail-ua0-f196.google.com ([209.85.217.196]:43968 "EHLO mail-ua0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbeBGX7A (ORCPT ); Wed, 7 Feb 2018 18:59:00 -0500 Received: by mail-ua0-f196.google.com with SMTP id i5so1763411uai.10; Wed, 07 Feb 2018 15:58:59 -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=ywtqmartQEunV9fbWF/KXCB7DPt00XLuf9ZvvJwsGcc=; b=s6Xsmpm0Vgpt+1i9TvcsARKatWTnqQ7wZcHIqb+iB0Ifi2BYHqwa6R2LEeGALtm54t WRE5HQVje8NSfbuCBbbSXHJS0GUSwrC38xfcIMX1uEKdfQN1ilyZkOdVdeQnRkaSXWd0 EwTO3eQF4ffcLKoxDxbI2day4YV5OWjwhxl7ufoJbrF70bLvNGk7X6Uksmuu9DGvPyP+ tIiDMSsOhUUWbRQKMjGaWc7SwOj6PPuH6wmzh+55ohaH6R7/dXtU77NZWV5je8sl7xNv mHtF6zQrG1PhGi8RSTShPvwmf/3w9Zz0hEVq2M6PGnzRiBCTffaIYkyg2HelGfLD+vTn n94w== 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=ywtqmartQEunV9fbWF/KXCB7DPt00XLuf9ZvvJwsGcc=; b=MDXJm5hEgKV3sv+godxPvTAdU72EGRUNhOxcbFaJ7TpYTI9mLhVd72L4gYf1KWFltk s7k3CSzWCfrFXilIQCkl7aXulexAPIan3q3JbZQOHmcJzexQpLxO0BcQv4Juji/Q5Qqv 9VxMJGXjMdMh0/Tx4wWWUfxmWLFHooZp9IFk+c5YBYMShK+Rxusz16IhFijzQDFKRB9D N3jgSQWh8/okteRJuDjd4joBuGSfQ9/zF+3reYcGaizK8YDgPW/yX0Q7ko0otoVCxUZo 2OYpXJf2XTrk0KKS4YyW221E+EB09CbAdwZHCYRkCndqe4bjmsJNaRWViysLalk36EOn Hozg== X-Gm-Message-State: APf1xPDoExavtyyvwDsc1cJRJ/dEHa4hmCRbIpdleTUXE3hfWlGdrYLN O3ZDfdkQJ4plOHZy9bbbHNDDSmpSy1ZEFQJwFiE= X-Received: by 10.159.41.33 with SMTP id t30mr6890296uat.16.1518047939278; Wed, 07 Feb 2018 15:58:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.70.21 with HTTP; Wed, 7 Feb 2018 15:58:58 -0800 (PST) In-Reply-To: <1517877294-4826-10-git-send-email-yamada.masahiro@socionext.com> References: <1517877294-4826-1-git-send-email-yamada.masahiro@socionext.com> <1517877294-4826-10-git-send-email-yamada.masahiro@socionext.com> From: Ulf Magnusson Date: Thu, 8 Feb 2018 00:58:58 +0100 Message-ID: Subject: Re: [PATCH 09/14] kconfig: test: test automatic submenu creation 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 a symbols has dependency on the preceding symbol, the menu entry > should become the submenu of the preceding one, and displayed with > deeper indentation. > > This is done by restructuring the menu tree in menu_finalize(). > It is a bit complicated computation, so let's add a test case. > > Signed-off-by: Masahiro Yamada > --- > > .../kconfig/tests/auto_submenu_creation/Kconfig | 50 ++++++++++++++++++++++ > .../tests/auto_submenu_creation/__init__.py | 12 ++++++ > .../tests/auto_submenu_creation/expected_stdout | 10 +++++ > 3 files changed, 72 insertions(+) > create mode 100644 scripts/kconfig/tests/auto_submenu_creation/Kconfig > create mode 100644 scripts/kconfig/tests/auto_submenu_creation/__init__.py > create mode 100644 scripts/kconfig/tests/auto_submenu_creation/expected_stdout > > diff --git a/scripts/kconfig/tests/auto_submenu_creation/Kconfig b/scripts/kconfig/tests/auto_submenu_creation/Kconfig > new file mode 100644 > index 0000000..9e11502 > --- /dev/null > +++ b/scripts/kconfig/tests/auto_submenu_creation/Kconfig > @@ -0,0 +1,50 @@ > +config A > + bool "A" > + default y > + > +config A0 > + bool "A0" > + depends on A > + default y > + help > + This depends on A, so should be a submenu of A. > + > +config A0_0 > + bool "A1_0" > + depends on A0 > + help > + Submenus are created recursively. > + This should be a submenu of A0. > + > +config A1 > + bool "A1" > + depends on A > + default y > + help > + This should line up with A0. > + > +choice > + prompt "choice" > + depends on A1 > + help > + Choice should become a submenu as well. > + > +config A1_0 > + bool "A1_0" > + > +config A1_1 > + bool "A1_1" > + > +endchoice > + > +config B > + bool "B" > + help > + This is independent of A. > + > +config C > + bool "C" > + depends on A > + help > + This depends on A, but not a consecutive item, so should not > + be a submenu. > diff --git a/scripts/kconfig/tests/auto_submenu_creation/__init__.py b/scripts/kconfig/tests/auto_submenu_creation/__init__.py > new file mode 100644 > index 0000000..dda866d > --- /dev/null > +++ b/scripts/kconfig/tests/auto_submenu_creation/__init__.py > @@ -0,0 +1,12 @@ > +""" > +Create submenu for symbols that depend on the preceding one > +=========================================================== > + > +If a symbols has dependency on the preceding symbol, the menu entry > +should become the submenu of the preceding one, and displayed with > +deeper indentation. > +""" > + > +def test(conf): > + assert conf.oldaskconfig() == 0 > + assert conf.stdout_contains('expected_stdout') > diff --git a/scripts/kconfig/tests/auto_submenu_creation/expected_stdout b/scripts/kconfig/tests/auto_submenu_creation/expected_stdout > new file mode 100644 > index 0000000..bf5236f > --- /dev/null > +++ b/scripts/kconfig/tests/auto_submenu_creation/expected_stdout > @@ -0,0 +1,10 @@ > +A (A) [Y/n/?] (NEW) > + A0 (A0) [Y/n/?] (NEW) > + A1_0 (A0_0) [N/y/?] (NEW) > + A1 (A1) [Y/n/?] (NEW) > + choice > + > 1. A1_0 (A1_0) (NEW) > + 2. A1_1 (A1_1) (NEW) > + choice[1-2?]: > +B (B) [N/y/?] (NEW) > +C (C) [N/y/?] (NEW) > -- > 2.7.4 > Reviewed-by: Ulf Magnusson