Received: by 10.223.185.116 with SMTP id b49csp8268234wrg; Thu, 1 Mar 2018 21:35:03 -0800 (PST) X-Google-Smtp-Source: AG47ELu9LqIlFfvWynH+wEfGD3owXEQpQDbHIJxk/jZahqy0rdL+A7v7ddiX687K/UoDz46x0F/M X-Received: by 10.99.54.196 with SMTP id d187mr2605423pga.154.1519968903127; Thu, 01 Mar 2018 21:35:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519968903; cv=none; d=google.com; s=arc-20160816; b=zXFZEw4FuH3CeCCltxfb3u+2bPFZXHSZdamW5+YVR4NqxA3RtvXkH9s55vW5m+dYbx 930BnECYJZ6elTcBQAuu/3wwkA27k3z8X3zqPyjJqdtIwvyFYaVupkgvULVHIFwb7IYc R8A+NiqKKG2sBa6RG7K2ZzYKLX6GOB14ofwUxAVRxrKeh4jtg8NuXc3gZgXsMbJewxpy DqHjtk4qGu2BE/xPAU/Wy8ywr7eBVknhn4mZqnLV1iCN/QZkfx8XG3nyjpT/WotFQB9+ RJZnQkY0mo76ER3fJqB21A1FWMMgn1towJUmmnN41efWzx1iWYedsJ3xAf3IAhhat8iC zz4A== 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=oNntiM8YDjzK8DDDlYwMBcd7P8ZgUmQckYBmYyraLDw=; b=X+FcM7Bp1/WCx/9I5XMWOhai7JBU6b4woSwU25FSGnr7gLxFul9YTz0ZWQsjfZqDRv KFhr775hFS1r53pix2NRLsuMD5FI8Gc95fCed7DzcSLnpGQ+uqX3d7yGyFHSw7yqv/Kn wtTnT5ef2yHm1T37xj3T1fAEuOKP06aWHA2ozG4/92U+u49MitIw3BaORd5eSwMUSdCs cWY3R5/u3BbtxxAPMMk5Sb4E/BLOtG0exG7lbogCvOtdrrtdJ7R+uf55qxFrHaEVkMA0 FMtsv4G6dYT3EpJ66Z+ei/t4ZNmJ68570MYQ3+hgB8X+pjkW4rPscPSWHGZGbyadTI+N aTIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=xXjcVt2e; 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 x24si3516445pgv.124.2018.03.01.21.34.48; Thu, 01 Mar 2018 21:35:03 -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=xXjcVt2e; 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 S1422781AbeCBEg1 (ORCPT + 99 others); Thu, 1 Mar 2018 23:36:27 -0500 Received: from conuserg-08.nifty.com ([210.131.2.75]:53158 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164985AbeCBEdr (ORCPT ); Thu, 1 Mar 2018 23:33:47 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w224WURM022085; Fri, 2 Mar 2018 13:32:39 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w224WURM022085 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1519965159; bh=oNntiM8YDjzK8DDDlYwMBcd7P8ZgUmQckYBmYyraLDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xXjcVt2eV4cmyAtH9TVATPbZ4LFNHw2q+hO5if3hP8KULs2wBaoRMHvBMcwVsiUPJ VNxeIJsQrgAi+nVxKxVh2R1T/TM26PLIK2gVUk0+mvum0UhriUCL1k7NSDE9AUwHuw CJElK4lpZ3Z8HCP1vZio+z9YmnWy4S5AGjRkm/zWE0lUsHSGXnuJCMUeffYvnEFgZS JHYuiL6KpRW8ZX1QDfbIARrPZgAfmJZ6PxJGEiZ/RsmIXr0T++36VMaBAeCA83Rkt4 ijV/Gtb1OnQ8S6vMzfrPHLiZpcPpWxC1kurb/NFXLvyutti2dqyxsU+1Ai+Y1ZfyUW o68nFcGRSzkTg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Michal Marek , Ulf Magnusson , Randy Dunlap , "Luis R . Rodriguez" , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v2 11/11] kconfig: unittest: test if recursive inclusion is detected Date: Fri, 2 Mar 2018 13:32:01 +0900 Message-Id: <1519965121-12017-12-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519965121-12017-1-git-send-email-yamada.masahiro@socionext.com> References: <1519965121-12017-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 Reviewed-by: Ulf Magnusson --- Changes in v2: - coding style clean-up based on PEP8, PEP257 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..0e4c839 --- /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