Received: by 10.223.176.5 with SMTP id f5csp1276257wra; Wed, 7 Feb 2018 16:17:24 -0800 (PST) X-Google-Smtp-Source: AH8x227BU2/Ibi1yIt4dR5xpqzdSyYsFHHn7o9wmqnnJXCDhyUC6enjBNUiKa+0T0NqnMU4FpPli X-Received: by 2002:a17:902:6006:: with SMTP id r6-v6mr7553606plj.78.1518049043954; Wed, 07 Feb 2018 16:17:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518049043; cv=none; d=google.com; s=arc-20160816; b=qklxB5w+xAPkv0FmJ44iIlhYXZLFTyC+zseDtUuVhyMzc3D1pquG39VTVyz0A3/KT5 RJ9U6xtSnXMiZW7bmie0d6FoiTs51wiMVmANzWDKDG8dCpkEBhY4yTuRRbXyBvwPdW5I A8i5p9MUqWxuwIDssD6B2kcolzdxRF7EHvw9KUKG6erkM7qp1d/JKWw05Wv72QryhazS QLS61rs8Vu4Ua7ZVljyjoWmEHede9ihm4k5ulE+g4k2qgaNN1WkL2lvBxPGEMgckAm7E S+3C9Yu1sX6tADNCF3r14DH5nfwuIwdz1qmRiA8TG249DGiRUu7izTDrg/C/UYxyZY7D xj/A== 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=QZ2wVMRmESDzcZPrarpwq3qxmyK6frXC93u3u5CsR/I=; b=0U62wWBmWSP4zUSPiftQ+tX2xmSIZSK1LeWDThxkNqLHXrGxQdzf99FNonKt+959HE orIOXSEAi31ahLGVEHO0yXs2W2PCrH+/rlmHjuLbM8CS6xNpPmtCRf8YetA9Vta4oYil TR8YCk1Qm9AmwQSeusvhRfwt9nCI1FjyHZUqO9i32+xCgLzQ7AS+BFe0Qj7rCiP0xo2O KBN2Mpt43LQkifsKcE1wE56ndONMw9Zy1SmoutcXl14ooYjhr0IKPZxyKKOJ7UE1Ay89 j/baeOuV/OIarXWzNpn26TG5SdwU4H6lCMn3DIaUqQVQNHkQd8L7Fz1dralMGtYgz3ZK ghXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=I4aSErt1; 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.17.09; Wed, 07 Feb 2018 16:17:23 -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=I4aSErt1; 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 S1751305AbeBHAP7 (ORCPT + 99 others); Wed, 7 Feb 2018 19:15:59 -0500 Received: from mail-vk0-f65.google.com ([209.85.213.65]:43584 "EHLO mail-vk0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750745AbeBHAP5 (ORCPT ); Wed, 7 Feb 2018 19:15:57 -0500 Received: by mail-vk0-f65.google.com with SMTP id x203so1715799vkx.10; Wed, 07 Feb 2018 16:15:57 -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=QZ2wVMRmESDzcZPrarpwq3qxmyK6frXC93u3u5CsR/I=; b=I4aSErt15cx2etWDeTa3quEb+npBGRnWnCQvpWiTW+SmHpWW2ebt1AnBg24EAv0fuK uel/bZDDBcfvRNE8REY4IRXTzXvNMpbFChmLs01jXz/5/HI/RGbUcklsJ/RzZ5qA/oFd HZiMgKUJZOUGsHVKikwMVqbPA9UTMjNfLAXP8x8Dv1D9SOzz6F4XcHVCQ2Ak1Ok0uM5F rJcthqxy/AM/q2KROcuEMwK7+k8d5GQB4XozoIG+sEc4NEKwmpx9+uQTbvFaymS4GOnC irWLhjShwGMAstBdkIIIt9vAxKVzXxayuboN7WFW6vY/KQU1HhrkHcHYMx500gI4Wk4r GQ5A== 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=QZ2wVMRmESDzcZPrarpwq3qxmyK6frXC93u3u5CsR/I=; b=EE2uWTK49/MMaOBYFPJjftyk9jesU58FXEhzwIkqvgxaDipP7YHRDxzx1RnMNgQupQ alAhKNJuGxAbaDQFW7/dug2qDvdI7fvEBODVTAwhx3pTDy/7WwjVKvDtGZbVm2XNGT+A cqND8FXvSTdIqh9nwH/XlsC5Nd94boM4j9j2uNNYBsiIXbt/VXOfYJ6tVgXUduUw3fa3 RFdvgw9MVRT63JIyJouPG55RJ+JCdQlHbreTDeolZBkkmfIat4BxVAP0FuvQ5uuTbKIh IP4QkuwZtagbFkBS2/WIvF7HTPsAqrw3Qr1QilI7DlvFUgVtOK3h+TeHNoWQlm7dDHVm L85w== X-Gm-Message-State: APf1xPD98hgj+qPlY2odNAXxXT0u20V3b1V9sBIgKXGfh1zVaEAZK7sn plELvNawD1W9YGvwHXd7p5rS0LPmBDoSFrZNa2U= X-Received: by 10.31.69.2 with SMTP id s2mr6822019vka.56.1518048956625; Wed, 07 Feb 2018 16:15:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.70.21 with HTTP; Wed, 7 Feb 2018 16:15:56 -0800 (PST) In-Reply-To: <1517877294-4826-14-git-send-email-yamada.masahiro@socionext.com> References: <1517877294-4826-1-git-send-email-yamada.masahiro@socionext.com> <1517877294-4826-14-git-send-email-yamada.masahiro@socionext.com> From: Ulf Magnusson Date: Thu, 8 Feb 2018 01:15:56 +0100 Message-ID: Subject: Re: [PATCH 13/14] kconfig: test: check if recursive dependencies are detected 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: > Recursive dependency should be detected and warned. Test this. > > Signed-off-by: Masahiro Yamada > --- > > scripts/kconfig/tests/warn_recursive_dep/Kconfig | 62 ++++++++++++++++++++++ > .../kconfig/tests/warn_recursive_dep/__init__.py | 10 ++++ > .../tests/warn_recursive_dep/expected_stderr | 33 ++++++++++++ > 3 files changed, 105 insertions(+) > create mode 100644 scripts/kconfig/tests/warn_recursive_dep/Kconfig > create mode 100644 scripts/kconfig/tests/warn_recursive_dep/__init__.py > create mode 100644 scripts/kconfig/tests/warn_recursive_dep/expected_stderr > > diff --git a/scripts/kconfig/tests/warn_recursive_dep/Kconfig b/scripts/kconfig/tests/warn_recursive_dep/Kconfig > new file mode 100644 > index 0000000..9ab2474 > --- /dev/null > +++ b/scripts/kconfig/tests/warn_recursive_dep/Kconfig > @@ -0,0 +1,62 @@ > +# depends on itself > + > +config A > + bool "A" > + depends on A > + > +# select itself > + > +config B > + bool > + select B > + > +# depends on each other > + > +config C1 > + bool "C1 Missing end quote here. Noticed because the output contains "Kconfig:16:warning: multi-line strings not supported". :) > + depends on C2 > + > +config C2 > + bool "C2" > + depends on C1 > + > +# depends on and select > + > +config D1 > + bool "D1" > + depends on D2 > + select D2 > + > +config D2 > + bool > + > +# depends on and imply > +# This is not recursive dependency > + > +config E1 > + bool "E1" > + depends on E2 > + imply E2 > + > +config E2 > + bool "E2" > + > +# property > + > +config F1 > + bool "F1" > + default F2 > + > +config F2 > + bool "F2" > + depends on F1 > + > +# menu > + > +menu "menu depending on its content" > + depends on G > + > +config G > + bool "G" > + > +endmenu > diff --git a/scripts/kconfig/tests/warn_recursive_dep/__init__.py b/scripts/kconfig/tests/warn_recursive_dep/__init__.py > new file mode 100644 > index 0000000..cdf2c13 > --- /dev/null > +++ b/scripts/kconfig/tests/warn_recursive_dep/__init__.py > @@ -0,0 +1,10 @@ > +""" > +Warn recursive inclusion > +======================== > + > +Recursive dependency should be warned. > +""" > + > +def test(conf): > + assert conf.oldaskconfig() == 0 > + assert conf.stderr_contains('expected_stderr') > diff --git a/scripts/kconfig/tests/warn_recursive_dep/expected_stderr b/scripts/kconfig/tests/warn_recursive_dep/expected_stderr > new file mode 100644 > index 0000000..ea47cae > --- /dev/null > +++ b/scripts/kconfig/tests/warn_recursive_dep/expected_stderr > @@ -0,0 +1,33 @@ > +Kconfig:16:warning: multi-line strings not supported > +Kconfig:9:error: recursive dependency detected! > +Kconfig:9: symbol B is selected by B > +For a resolution refer to Documentation/kbuild/kconfig-language.txt > +subsection "Kconfig recursive dependency limitations" > + > +Kconfig:3:error: recursive dependency detected! > +Kconfig:3: symbol A depends on A > +For a resolution refer to Documentation/kbuild/kconfig-language.txt > +subsection "Kconfig recursive dependency limitations" > + > +Kconfig:15:error: recursive dependency detected! > +Kconfig:15: symbol C1 depends on C2 > +Kconfig:19: symbol C2 depends on C1 > +For a resolution refer to Documentation/kbuild/kconfig-language.txt > +subsection "Kconfig recursive dependency limitations" > + > +Kconfig:30:error: recursive dependency detected! > +Kconfig:30: symbol D2 is selected by D1 > +Kconfig:25: symbol D1 depends on D2 > +For a resolution refer to Documentation/kbuild/kconfig-language.txt > +subsection "Kconfig recursive dependency limitations" > + > +Kconfig:59:error: recursive dependency detected! > +Kconfig:59: symbol G depends on G > +For a resolution refer to Documentation/kbuild/kconfig-language.txt > +subsection "Kconfig recursive dependency limitations" > + > +Kconfig:50:error: recursive dependency detected! > +Kconfig:50: symbol F2 depends on F1 > +Kconfig:48: symbol F1 default value contains F2 > +For a resolution refer to Documentation/kbuild/kconfig-language.txt > +subsection "Kconfig recursive dependency limitations" > -- > 2.7.4 > Besides the missing end quote: Reviewed-by: Ulf Magnusson