Received: by 10.223.176.5 with SMTP id f5csp61061wra; Mon, 5 Feb 2018 16:41:47 -0800 (PST) X-Google-Smtp-Source: AH8x227MHTAkIyYplpN7kEwLlpDwh3rIsizWdB2cn0YkbVbRPbD2+Bjdc6DBAxPVkKB2GTUf4eNP X-Received: by 10.99.120.8 with SMTP id t8mr451874pgc.371.1517877707558; Mon, 05 Feb 2018 16:41:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517877707; cv=none; d=google.com; s=arc-20160816; b=Uoh+quyFxnps1XkmLlKR0ECYMxf7gp3PjLTz6TGBUzl7hzpC+q5P7SUnHUff7UJoj3 KHedXwmo81R9FnI7LYKEU/Va6vd85iK11glgF5NnPkF4qNE1rMZhEcoBHJpzkyOrnRpz 2iu/NVFZuVLyeTduC8nGpK1CG8E4/f4LT9No821i1eKTTGx3kfmHkJ6iTR7GAZ20UIyv tFYOezTLKp52YTQB1zcIF0Cp26MTKo6efBiDBROKBDqRNU+IJOS3FpMclfwSyHxQgpQg r9pEcQXFSMSBf6hsLbdOCW08aiBU5QXfV3DZlgN21t+rGFycMsRWYJG95usA3f/vT1uH C96w== 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=e+bBRzoO0V5YQsvcXSf66n+mUtbbyoF3YBYC04GSbmY=; b=WeIly4jfMSJsQhTVYtP/SQcSlDiUWhgGJEEv0jAUXMNfbswY06He4vc9/wIwUXNCvy m/gbR9GElrMvELYJ5JlVHDgv1cUDfy6yNCXixP8MWbZlNU60dOxznmA2JpCPhsWo+REH NXn3aFwo9j5fyV97BvKblsYDFccCMkKST9Ha7bdguaw4p65dn5hOPW7oUaOEuj9LuU14 CtoqKoj+et2oV96bjuq2MDESIxyIzIIg5dcJKIUiQAHZM2PW5noe4p/tZTqC0NPF9E3v us9YPj9wvkBWyTXG8v7pctHBXTLHW5m+5oOi/XPwaSlcJv9wq3sbWP9qeJJW5EOha1jB hC9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=hK/ZFrNh; 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 37-v6si576824plc.215.2018.02.05.16.41.30; Mon, 05 Feb 2018 16:41:47 -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=hK/ZFrNh; 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 S1752686AbeBFAkU (ORCPT + 99 others); Mon, 5 Feb 2018 19:40:20 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:39885 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751514AbeBFAh6 (ORCPT ); Mon, 5 Feb 2018 19:37:58 -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 w160ZHAt011351; Tue, 6 Feb 2018 09:35:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w160ZHAt011351 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1517877332; bh=e+bBRzoO0V5YQsvcXSf66n+mUtbbyoF3YBYC04GSbmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hK/ZFrNhsaaZXv6SvrBuGXZa+2fFWSGfzBj6F+LlYj3Uyfbk8kt3IcN2NsXPKaEZb XsicLzJBfAFf0HgevRnSg6zxtWabHaen1r/wX8Od34wjXgB5KlDGkxWA/QSi/8XHpj 8u1u/8sUzDa5ijJsfUhZ0flMv8qRajAK5alPO5Jt/srKQ0rqMfB8vha6Q+wCaL+IxV fAw1hiT72hemIRSvFq085r/xQFyWyPO4KD+rH2C7z1ubvlRzsS9+jsRRQRifKk+Frv 9H8DMTcM8UgQYyf+P30bwD0D4vShj+yNSvobiBZr6tcntIDuqgwXtDDhZWGWyZHsSI u6PsvZPKiAzSg== 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 14/14] kconfig: test: check if recursive inclusion is detected Date: Tue, 6 Feb 2018 09:34:54 +0900 Message-Id: <1517877294-4826-15-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 recursive inclusion is detected, it should fail with error messages. Test this. Signed-off-by: Masahiro Yamada --- scripts/kconfig/tests/err_recursive_inc/Kconfig | 1 + scripts/kconfig/tests/err_recursive_inc/Kconfig.inc | 1 + scripts/kconfig/tests/err_recursive_inc/__init__.py | 10 ++++++++++ scripts/kconfig/tests/err_recursive_inc/expected_stderr | 4 ++++ 4 files changed, 16 insertions(+) create mode 100644 scripts/kconfig/tests/err_recursive_inc/Kconfig create mode 100644 scripts/kconfig/tests/err_recursive_inc/Kconfig.inc create mode 100644 scripts/kconfig/tests/err_recursive_inc/__init__.py create mode 100644 scripts/kconfig/tests/err_recursive_inc/expected_stderr diff --git a/scripts/kconfig/tests/err_recursive_inc/Kconfig b/scripts/kconfig/tests/err_recursive_inc/Kconfig new file mode 100644 index 0000000..3ce7a3f --- /dev/null +++ b/scripts/kconfig/tests/err_recursive_inc/Kconfig @@ -0,0 +1 @@ +source "Kconfig.inc" diff --git a/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc b/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc new file mode 100644 index 0000000..1fab1c1 --- /dev/null +++ b/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc @@ -0,0 +1 @@ +source "Kconfig" diff --git a/scripts/kconfig/tests/err_recursive_inc/__init__.py b/scripts/kconfig/tests/err_recursive_inc/__init__.py new file mode 100644 index 0000000..1dae64f --- /dev/null +++ b/scripts/kconfig/tests/err_recursive_inc/__init__.py @@ -0,0 +1,10 @@ +""" +Detect recursive inclusion error +================================ + +If recursive inclusion is detected, it should fail with error messages. +""" + +def test(conf): + assert conf.oldaskconfig() != 0 + assert conf.stderr_contains('expected_stderr') diff --git a/scripts/kconfig/tests/err_recursive_inc/expected_stderr b/scripts/kconfig/tests/err_recursive_inc/expected_stderr new file mode 100644 index 0000000..b256c91 --- /dev/null +++ b/scripts/kconfig/tests/err_recursive_inc/expected_stderr @@ -0,0 +1,4 @@ +Kconfig:1: recursive inclusion detected. Inclusion path: + current file : 'Kconfig' + included from: 'Kconfig.inc:1' + included from: 'Kconfig:3' -- 2.7.4