Received: by 10.223.185.116 with SMTP id b49csp8364297wrg; Thu, 1 Mar 2018 23:55:26 -0800 (PST) X-Google-Smtp-Source: AG47ELvOTKOLVDLyWN1Ikn9cyevDDGVft6iK1XYXb1matf12J5vB82G7bKMop6HKMTLwysNlYY8V X-Received: by 2002:a17:902:8215:: with SMTP id x21-v6mr4600199pln.164.1519977325871; Thu, 01 Mar 2018 23:55:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519977325; cv=none; d=google.com; s=arc-20160816; b=GDID6fGW/YD+SCkvd1uIEMBrCkgPo3Czx/hT+pqfkIe7KaSgXHZ6HZk4XGID5FQcE7 n4gF4L2LvRtVjfaGFhVI1VKKQLjIwLSNQSuFgoTAp3R9ldE+TZB5d4b4QOaQ6cuQkjdl ugynJojhPevrrzFAduM+//UTX3FGRAf6TW2f+P/19TIC6ofYuwfGvWtorpTaKkkLYO24 OeRdFUJhkjDrOKRutNp8NETAHgtq6FAvlekPlWUuUHj6OZRcGusRH4VBZVQW6QM+o5Ml jX/Yjez6k0PLDz5L4Dq39B48iVWOxjT0ASFuks+lNY1DUFvoxD6oSXC52QSxve+eB15n z4MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=hWjezvspkvNu31aGqF+LUyr8ea72Y8mnCU19nRIbPR4=; b=CpxN3IOdj5XPlzFwLjHJDkRcYRDCU/zTy44WJ+rqyRc4gdWlyaYFa5YDHDLzjLWGkg vrS3y8RSdz/tbSOYqBfWrp0UczyVeATpSnoXahofTYIl2bofSEeAcX6tgr/F8VuJbAHR SZjO7xJMVEJas0z0QR5d9/zv2B+hHlltLhW0CZ7uKJRjb+Hrw1UUQqqAsxj8/UwW/NVi Adny0najYmakDtpsntnX2hJJGbMLgeNm7X8rU2y6gmSRV+x1wWUcIw9excFdh2DHIbh1 WsoRyT3VzlJ0hoiFz1+FNPTrbBCYwSxIshvPnSDd6xx/CotFipJqFFfB1rDginVQUjdT sAMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=2klS3qdr; 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 k198si3667148pgc.545.2018.03.01.23.55.09; Thu, 01 Mar 2018 23:55: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=2klS3qdr; 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 S1164510AbeCBHJL (ORCPT + 99 others); Fri, 2 Mar 2018 02:09:11 -0500 Received: from conssluserg-06.nifty.com ([210.131.2.91]:35976 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932927AbeCBHJI (ORCPT ); Fri, 2 Mar 2018 02:09:08 -0500 Received: from mail-ua0-f171.google.com (mail-ua0-f171.google.com [209.85.217.171]) (authenticated) by conssluserg-06.nifty.com with ESMTP id w2278sA6014642; Fri, 2 Mar 2018 16:08:54 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com w2278sA6014642 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1519974535; bh=hWjezvspkvNu31aGqF+LUyr8ea72Y8mnCU19nRIbPR4=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=2klS3qdr5ohxY6Ahkh8aW2Gx2GFciYHqLoQUpP6SfUevk2ohrGydU81xVbX26WPm7 QV4S/GtJmOnMzmkv4hgKaDyl8Wn+qIOqBH7OcuIPEB+kovj4yLdTJB8jzptNSCBye4 wyOjwjKzeLoUUhjn/2x6HtASHmr1HyeOezsxA6oTzOZQ465ZxoX3ZmrjG9L7nV1T/C 50DcctlInM2SJ+9DTjOSF9jcuCtL25dy9zML65IH2WAZ/Qr8zZx0hdTycIuYB69sZk Pq9jnJZ3JdITjxHUKLs54GQAC/vbcQUP1oU7hbjnzi1XHy5ShDjUvcZ70ei05ojWWv C7Llb+HzXflsw== X-Nifty-SrcIP: [209.85.217.171] Received: by mail-ua0-f171.google.com with SMTP id d1so4580732ual.13; Thu, 01 Mar 2018 23:08:54 -0800 (PST) X-Gm-Message-State: APf1xPAmLwL1G+3Avw5FmQOU9472oxlsLqKazVxRHq0Lzf5XyEHU19pr CqZYj27qSyjZu/bj9owQa9kLbqLsHDJYV8al/qc= X-Received: by 10.176.2.244 with SMTP id 107mr3045749uah.52.1519974533579; Thu, 01 Mar 2018 23:08:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.32.138 with HTTP; Thu, 1 Mar 2018 23:08:13 -0800 (PST) In-Reply-To: <1519965121-12017-12-git-send-email-yamada.masahiro@socionext.com> References: <1519965121-12017-1-git-send-email-yamada.masahiro@socionext.com> <1519965121-12017-12-git-send-email-yamada.masahiro@socionext.com> From: Masahiro Yamada Date: Fri, 2 Mar 2018 16:08:13 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 11/11] kconfig: unittest: test if recursive inclusion is detected To: Linux Kbuild mailing list Cc: Sam Ravnborg , Michal Marek , Ulf Magnusson , Randy Dunlap , "Luis R . Rodriguez" , Masahiro Yamada , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-03-02 13:32 GMT+09:00 Masahiro Yamada : > 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' Currently, the line number is wrong. The following patch should be applied first https://patchwork.kernel.org/patch/10253541/ Then, expected data should be changed included from: 'Kconfig:3' -> included from: 'Kconfig:1' -- Best Regards Masahiro Yamada