Received: by 10.223.176.5 with SMTP id f5csp62131wra; Mon, 5 Feb 2018 16:43:15 -0800 (PST) X-Google-Smtp-Source: AH8x2265XX/DxT1u16t6qeK3FP0YiqwI5MqXP+ffn07UjyAWfTvKiFuTZC1+VC1HbCe5sGutro/g X-Received: by 2002:a17:902:49:: with SMTP id 67-v6mr583353pla.424.1517877795854; Mon, 05 Feb 2018 16:43:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517877795; cv=none; d=google.com; s=arc-20160816; b=WOP1XAFVzUHuVGipx/du0nCHnwRtyWnSlqtnFcKWZ/fXTcuSFFcZDrdoTSK/7WyXlg d2xVBVaABmg3JwTTAoAv62Y52TEzRNXHG3iOCFrygxioCJa3GpHU0GeZ+yb6Ja38DK+E xoPbAcWFw5wGzfA1Ab0zKnjeN69uEsyu2yjHNgOHzzKVPlgSdhzh3o8sg+FDJLgjE5MA OJgSluul62s3eckZKNXRZl2w2Ou0SmciUlmp54jzVJN6DSZyfH5S/5DComvrQSTNl3Qo F7tLisEGGvQdu241+VwaRUW+Lxx06+zQxRB5t+UvID8TnTB6RnZYsnTNPFpTBMCFYqwe tsRg== 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=OgysUZNJJuQDhed5u2YwuFH43q8TTfIJ3GyWfIBQjIM=; b=EHp3rV0smpSztpxylJk6w/VBsdBEuLkibDzj28BzzYQsiDEPGqVT2AjYksp1/zEyrj U96fD5BY+uD2mX29O/Hgh4hEaMFowkNYf1hJSPlBG/PByd/TnInSd5tin2Lwffk4/3tZ jG2gFpLc+SjfEsT/eGOCuLVfpqnwzVABOthpyddLdkly5zP1IFgRx4fKp8487zMv7hny yF/I/Jn9Upx9debwOVsrBrr9xOgtqsEnqu105TfTZuBQWv26X0SqhBWwnzFvrZjxxGHb WIuFh+n3wLFXrFLDjrtiT/0R9DmMZ+6fCVu/+ojdIJRbs9qL36WfLy6luCQNyCQRKu1/ mWRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=CMKz2JAQ; 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 f125si268942pgc.17.2018.02.05.16.42.59; Mon, 05 Feb 2018 16:43:15 -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=CMKz2JAQ; 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 S1752696AbeBFAk1 (ORCPT + 99 others); Mon, 5 Feb 2018 19:40:27 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:39820 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752286AbeBFAh5 (ORCPT ); Mon, 5 Feb 2018 19:37:57 -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 w160ZHAs011351; Tue, 6 Feb 2018 09:35:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w160ZHAs011351 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1517877331; bh=OgysUZNJJuQDhed5u2YwuFH43q8TTfIJ3GyWfIBQjIM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CMKz2JAQ2Ozx+doQHEdyx6IFHHv9LFj7gas9guEE+byf4q1NLh1Y/JxkjeVtMlGI3 v6PC3DrnMgELTbcU4c2BuB0jJ3/lQX+uJFUnK6DMrhFpsPEHpuLeN08YbKZasPd/3H luNx4vpp/f/V5qyjBE9rW0ktFurapRAGRyeZNm4VyJJv6Zc/QrfwNyoCnbKhospuUF 8qrPJScvG7s6ZUQbi2HH8fKsKTO7CeJSKmZMVGjm0hvxKJy+eta33UnbEWM7plz44W 9BO7hNtKfZ3UCfigNq3yGjJUgpMXTjN78po7orsOlVNeRpl8zD9api43quU7jRtALp IphZkH/vtF2tA== 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 13/14] kconfig: test: check if recursive dependencies are detected Date: Tue, 6 Feb 2018 09:34:53 +0900 Message-Id: <1517877294-4826-14-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 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 + 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