All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Magnusson <ulfalizer@gmail.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Nicolas Pitre <nicolas.pitre@linaro.org>,
	"Luis R . Rodriguez" <mcgrof@suse.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Sam Ravnborg <sam@ravnborg.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 13/14] kconfig: test: check if recursive dependencies are detected
Date: Thu, 8 Feb 2018 01:15:56 +0100	[thread overview]
Message-ID: <CAFkk2KQv3oXWVdvyH9EPhmCiOEX1Ab++wvcsd+=gP-8RvTua+g@mail.gmail.com> (raw)
In-Reply-To: <1517877294-4826-14-git-send-email-yamada.masahiro@socionext.com>

On Tue, Feb 6, 2018 at 1:34 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> Recursive dependency should be detected and warned.  Test this.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>  scripts/kconfig/tests/warn_recursive_dep/Kconfig   | 62 ++++++++++++++++++++++
>  .../kconfig/tests/warn_recursive_dep/__init__.py   | 10 ++++
>  .../tests/warn_recursive_dep/expected_stderr       | 33 ++++++++++++
>  3 files changed, 105 insertions(+)
>  create mode 100644 scripts/kconfig/tests/warn_recursive_dep/Kconfig
>  create mode 100644 scripts/kconfig/tests/warn_recursive_dep/__init__.py
>  create mode 100644 scripts/kconfig/tests/warn_recursive_dep/expected_stderr
>
> diff --git a/scripts/kconfig/tests/warn_recursive_dep/Kconfig b/scripts/kconfig/tests/warn_recursive_dep/Kconfig
> new file mode 100644
> index 0000000..9ab2474
> --- /dev/null
> +++ b/scripts/kconfig/tests/warn_recursive_dep/Kconfig
> @@ -0,0 +1,62 @@
> +# depends on itself
> +
> +config A
> +       bool "A"
> +       depends on A
> +
> +# select itself
> +
> +config B
> +       bool
> +       select B
> +
> +# depends on each other
> +
> +config C1
> +       bool "C1

Missing end quote here. Noticed because the output contains
"Kconfig:16:warning: multi-line strings not supported". :)

> +       depends on C2
> +
> +config C2
> +       bool "C2"
> +       depends on C1
> +
> +# depends on and select
> +
> +config D1
> +       bool "D1"
> +       depends on D2
> +       select D2
> +
> +config D2
> +       bool
> +
> +# depends on and imply
> +# This is not recursive dependency
> +
> +config E1
> +       bool "E1"
> +       depends on E2
> +       imply E2
> +
> +config E2
> +       bool "E2"
> +
> +# property
> +
> +config F1
> +       bool "F1"
> +       default F2
> +
> +config F2
> +       bool "F2"
> +       depends on F1
> +
> +# menu
> +
> +menu "menu depending on its content"
> +       depends on G
> +
> +config G
> +       bool "G"
> +
> +endmenu
> diff --git a/scripts/kconfig/tests/warn_recursive_dep/__init__.py b/scripts/kconfig/tests/warn_recursive_dep/__init__.py
> new file mode 100644
> index 0000000..cdf2c13
> --- /dev/null
> +++ b/scripts/kconfig/tests/warn_recursive_dep/__init__.py
> @@ -0,0 +1,10 @@
> +"""
> +Warn recursive inclusion
> +========================
> +
> +Recursive dependency should be warned.
> +"""
> +
> +def test(conf):
> +    assert conf.oldaskconfig() == 0
> +    assert conf.stderr_contains('expected_stderr')
> diff --git a/scripts/kconfig/tests/warn_recursive_dep/expected_stderr b/scripts/kconfig/tests/warn_recursive_dep/expected_stderr
> new file mode 100644
> index 0000000..ea47cae
> --- /dev/null
> +++ b/scripts/kconfig/tests/warn_recursive_dep/expected_stderr
> @@ -0,0 +1,33 @@
> +Kconfig:16:warning: multi-line strings not supported
> +Kconfig:9:error: recursive dependency detected!
> +Kconfig:9:     symbol B is selected by B
> +For a resolution refer to Documentation/kbuild/kconfig-language.txt
> +subsection "Kconfig recursive dependency limitations"
> +
> +Kconfig:3:error: recursive dependency detected!
> +Kconfig:3:     symbol A depends on A
> +For a resolution refer to Documentation/kbuild/kconfig-language.txt
> +subsection "Kconfig recursive dependency limitations"
> +
> +Kconfig:15:error: recursive dependency detected!
> +Kconfig:15:    symbol C1 depends on C2
> +Kconfig:19:    symbol C2 depends on C1
> +For a resolution refer to Documentation/kbuild/kconfig-language.txt
> +subsection "Kconfig recursive dependency limitations"
> +
> +Kconfig:30:error: recursive dependency detected!
> +Kconfig:30:    symbol D2 is selected by D1
> +Kconfig:25:    symbol D1 depends on D2
> +For a resolution refer to Documentation/kbuild/kconfig-language.txt
> +subsection "Kconfig recursive dependency limitations"
> +
> +Kconfig:59:error: recursive dependency detected!
> +Kconfig:59:    symbol G depends on G
> +For a resolution refer to Documentation/kbuild/kconfig-language.txt
> +subsection "Kconfig recursive dependency limitations"
> +
> +Kconfig:50:error: recursive dependency detected!
> +Kconfig:50:    symbol F2 depends on F1
> +Kconfig:48:    symbol F1 default value contains F2
> +For a resolution refer to Documentation/kbuild/kconfig-language.txt
> +subsection "Kconfig recursive dependency limitations"
> --
> 2.7.4
>

Besides the missing end quote:

Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>

  reply	other threads:[~2018-02-08  0:15 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06  0:34 [PATCH 00/14] Add Kconfig unit tests Masahiro Yamada
2018-02-06  0:34 ` Masahiro Yamada
2018-02-06  0:34 ` [PATCH 01/14] kconfig: send error messages to stderr Masahiro Yamada
2018-02-07 20:24   ` Ulf Magnusson
2018-02-08  1:49     ` Masahiro Yamada
2018-02-08  2:02       ` Ulf Magnusson
2018-02-06  0:34 ` [PATCH 02/14] kconfig: do not write choice values when their dependency becomes n Masahiro Yamada
2018-02-07 22:55   ` Ulf Magnusson
2018-02-08  2:42     ` Masahiro Yamada
2018-02-08  2:46       ` Ulf Magnusson
2018-02-08 21:21         ` Ulf Magnusson
2018-02-06  0:34 ` [PATCH 03/14] kconfig: show '?' prompt even if no help text is available Masahiro Yamada
2018-02-07 20:28   ` Ulf Magnusson
2018-02-06  0:34 ` [PATCH 04/14] kconfig: print additional new line for choice for redirection Masahiro Yamada
2018-02-07 23:34   ` Ulf Magnusson
2018-02-08  6:00     ` Masahiro Yamada
2018-02-06  0:34 ` [PATCH 05/14] kconfig: remove 'config*' pattern from .gitignnore Masahiro Yamada
2018-02-07 23:43   ` Ulf Magnusson
2018-02-06  0:34 ` [PATCH 06/14] kbuild: define PYTHON2 and PYTHON3 variables instead of PYTHON Masahiro Yamada
2018-02-06  0:34   ` Masahiro Yamada
2018-02-06  9:34   ` Greg Kroah-Hartman
2018-02-06  9:34     ` Greg Kroah-Hartman
2018-02-06 10:44     ` Masahiro Yamada
2018-02-06 10:44       ` Masahiro Yamada
2018-02-06 13:10       ` Greg Kroah-Hartman
2018-02-06 13:10         ` Greg Kroah-Hartman
2018-02-06 17:07         ` Luck, Tony
2018-02-06 17:07           ` Luck, Tony
2018-02-06  0:34 ` [PATCH 07/14] kconfig: test: add framework for Kconfig unit-tests Masahiro Yamada
2018-02-08  0:35   ` Ulf Magnusson
2018-02-06  0:34 ` [PATCH 08/14] kconfig: test: add basic 'choice' tests Masahiro Yamada
2018-02-07 23:57   ` Ulf Magnusson
2018-02-06  0:34 ` [PATCH 09/14] kconfig: test: test automatic submenu creation Masahiro Yamada
2018-02-07 23:58   ` Ulf Magnusson
2018-02-06  0:34 ` [PATCH 10/14] kconfig: test: check if new symbols in choice are asked Masahiro Yamada
2018-02-08  0:09   ` Ulf Magnusson
2018-02-06  0:34 ` [PATCH 11/14] kconfig: test: check .config sanity for choice values with unmet dep Masahiro Yamada
2018-02-08  0:11   ` Ulf Magnusson
2018-02-06  0:34 ` [PATCH 12/14] kconfig: test: check visibility of tristate choice values in y choice Masahiro Yamada
2018-02-08  0:13   ` Ulf Magnusson
2018-02-06  0:34 ` [PATCH 13/14] kconfig: test: check if recursive dependencies are detected Masahiro Yamada
2018-02-08  0:15   ` Ulf Magnusson [this message]
2018-02-06  0:34 ` [PATCH 14/14] kconfig: test: check if recursive inclusion is detected Masahiro Yamada
2018-02-08  0:16   ` Ulf Magnusson
2018-02-06  9:38 ` [PATCH 00/14] Add Kconfig unit tests Greg Kroah-Hartman
2018-02-06  9:38   ` Greg Kroah-Hartman
2018-02-07 23:19   ` Ulf Magnusson
2018-02-07 23:19     ` Ulf Magnusson
2018-02-18 19:38 ` Sam Ravnborg
2018-02-18 19:38   ` Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFkk2KQv3oXWVdvyH9EPhmCiOEX1Ab++wvcsd+=gP-8RvTua+g@mail.gmail.com' \
    --to=ulfalizer@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@suse.com \
    --cc=michal.lkml@markovi.net \
    --cc=nicolas.pitre@linaro.org \
    --cc=rdunlap@infradead.org \
    --cc=sam@ravnborg.org \
    --cc=torvalds@linux-foundation.org \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.