From patchwork Tue Mar 13 09:12:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131413 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp483010ljb; Tue, 13 Mar 2018 02:14:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELsR9IBOFcrxPU1g4eOhyayaACUXA4CwTcIsFR1C2YJT/wyWTD5D19oD6x841SToHzA5YCoY X-Received: by 10.99.117.76 with SMTP id f12mr9344341pgn.410.1520932457682; Tue, 13 Mar 2018 02:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520932457; cv=none; d=google.com; s=arc-20160816; b=z7ftRuLjuT8ku7QUNX3wKCrL6WZCOLVQ1ju9CHyOtgMdvaIDVa6Y2haMzBAg2IBGCL bmmK8Lavz6cPh5fY4twGPCezm3/7XNhl2GLOlYLDN+7X9cIkLBBR8ce8LpMbhQ7JtTjt R3JMVwYt6dOEBWNO0eyPTQ5P68GjcNraOTfRBdbQ4j4idYkubCcd4ihSRVCsdIYpoqxy h84Ty/mlnmC65YmGqXubPLzp/zLe/oCwyzqO3wY6KcWvrfKQMNx7VYYGCFLmxT92vcpN pDRcAyTmo+D71KDgWU2r/5GM64811Wli2Wejt1S99IInNaUt1r5oHMBl2h7O8aC6pnn3 foGg== 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=98IaRAfWA0Ot0LakJPD7ReKuTfpTbSHOVIAs/wKQwjE=; b=0im/eaptk6NNShkWSTIlJUE5TR3iO8zkxScOglVKohMh3Adam3q1YpaSyNymcwR8Nn dpXZMG2+JEb0Zgx/b0Z6qxpqCtRi+czuGDYZRieDS1Bptfz4PkUWlpeEbt+4GhdAx2Xu SfgI/zE8ngFGom78HDeZN+K7Wfy56puvo9uXJj1W2MuV5ZevWuFQQcPquDnZgvnK3idr AFR+QVhElBOhxhIBFeB7XLOn9tU7U+r1tLSJ4Doa/7y5lbyfH3gA402hd8NDmtVppXgC M7uKwZM2tMApCrNHcAs1R5s1C2qGDfX6krQ4xn5RFKZZquw28AyDgmSW5fRv+OmeHx0t /daw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=M18W/8df; 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 4-v6si1334564plb.205.2018.03.13.02.14.17; Tue, 13 Mar 2018 02:14:17 -0700 (PDT) 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=M18W/8df; 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 S1752566AbeCMJOO (ORCPT + 28 others); Tue, 13 Mar 2018 05:14:14 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:41840 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752302AbeCMJOB (ORCPT ); Tue, 13 Mar 2018 05:14:01 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id w2D9CIoC016505; Tue, 13 Mar 2018 18:12:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w2D9CIoC016505 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1520932347; bh=98IaRAfWA0Ot0LakJPD7ReKuTfpTbSHOVIAs/wKQwjE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M18W/8df9+58JUVM2Quj2vyLZjpxiNZaQVmZ4jAUJ1JHH9XU0PKMSC0OXlYMPYS6z bBobsSg84AznztCCtiXedaQ+/9qfF/r2Rx2fvQcNQWuRh9q5w+FLFqqvhK0JIDQe6H sfa5RX343DSlphXqhlrfoXfzsKWuHsagR1SbuNAzBSr1hZkv/wJPFylD0Uaa3JWD7m 36E1onzaKW/POm9unUBIlJRBc1JQ5SamRbfCYxUQZF4IrXMPSBcpIan5S5PI7kNQc6 0EvEOH+zy18GCfHCevoj+MIUwFURQYxg6SWTpFXYBBjELs11ACcz3CZJCsvjhZ41l6 jJL6dMDzU1g5Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Ulf Magnusson , Randy Dunlap , "Luis R . Rodriguez" , Tony Luck , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v3 11/11] kconfig: tests: test if recursive inclusion is detected Date: Tue, 13 Mar 2018 18:12:12 +0900 Message-Id: <1520932332-2449-12-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520932332-2449-1-git-send-email-yamada.masahiro@socionext.com> References: <1520932332-2449-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. This also tests the line numbers in the error message, fixed by commit 5ae6fcc4bb82 ("kconfig: fix line number in recursive inclusion error message"). Signed-off-by: Masahiro Yamada Reviewed-by: Ulf Magnusson --- Changes in v3: - Replace the test code with the one used by commit 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/Kconfig2 | 1 + scripts/kconfig/tests/err_recursive_inc/Kconfig3 | 1 + scripts/kconfig/tests/err_recursive_inc/__init__.py | 10 ++++++++++ scripts/kconfig/tests/err_recursive_inc/expected_stderr | 5 +++++ 5 files changed, 18 insertions(+) create mode 100644 scripts/kconfig/tests/err_recursive_inc/Kconfig create mode 100644 scripts/kconfig/tests/err_recursive_inc/Kconfig2 create mode 100644 scripts/kconfig/tests/err_recursive_inc/Kconfig3 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 diff --git a/scripts/kconfig/tests/err_recursive_inc/Kconfig b/scripts/kconfig/tests/err_recursive_inc/Kconfig new file mode 100644 index 0000000..f21c890 --- /dev/null +++ b/scripts/kconfig/tests/err_recursive_inc/Kconfig @@ -0,0 +1 @@ +source "Kconfig2" diff --git a/scripts/kconfig/tests/err_recursive_inc/Kconfig2 b/scripts/kconfig/tests/err_recursive_inc/Kconfig2 new file mode 100644 index 0000000..b341502 --- /dev/null +++ b/scripts/kconfig/tests/err_recursive_inc/Kconfig2 @@ -0,0 +1 @@ +source "Kconfig3" diff --git a/scripts/kconfig/tests/err_recursive_inc/Kconfig3 b/scripts/kconfig/tests/err_recursive_inc/Kconfig3 new file mode 100644 index 0000000..1fab1c1 --- /dev/null +++ b/scripts/kconfig/tests/err_recursive_inc/Kconfig3 @@ -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..84cc0a1 --- /dev/null +++ b/scripts/kconfig/tests/err_recursive_inc/expected_stderr @@ -0,0 +1,5 @@ +Kconfig:1: recursive inclusion detected. Inclusion path: + current file : 'Kconfig' + included from: 'Kconfig3:1' + included from: 'Kconfig2:1' + included from: 'Kconfig:1'