From patchwork Tue Feb 6 00:34:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 126938 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp2442149ljc; Mon, 5 Feb 2018 16:40:25 -0800 (PST) X-Google-Smtp-Source: AH8x2258+9bPjyIJpx/KIyQU7Z+HpNrF2GsojmpcgqeZnAhmwlWHzJqjU2w2m/1mH51GedDPgsmw X-Received: by 10.98.10.25 with SMTP id s25mr569226pfi.137.1517877625098; Mon, 05 Feb 2018 16:40:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517877625; cv=none; d=google.com; s=arc-20160816; b=VRJe2RvwCttRTBemqx7uVKRhk7J6hpYYvkd1oJNOiMvE5REYJc0yYhioYNOCpqdhG4 VvjkOOsuAG+y6RaaAxjbwAqQm3lnNXr45eCD1brXnGXBAVzBj4VXqwSgzK6U8ISMyXsY QA5SNO59OkTha19Kx+SKaPfl6mf1+zRm0JWVD+QykYZiBSrKTPA8theSSfzRuh2HWtFo 7zrpSGqBhl3VhgWPVjNErYXQtZIzY9Y4OiUScPqe3wogXeMxk6ziXDZt4fk/OisQoWm0 LfJl4TS6sldYnUP6fvqAZfd+QesdTp6Ul1ONJ6b96839y02syFDI13myICg0mflamPbo rO2Q== 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 x63si709625pfk.335.2018.02.05.16.40.24; Mon, 05 Feb 2018 16:40:25 -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 S1752497AbeBFAkW (ORCPT + 21 others); Mon, 5 Feb 2018 19:40:22 -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 -- 2.7.4 Reviewed-by: Ulf Magnusson 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'