Skip to content

Commit

Permalink
kconfig: tests: test if recursive inclusion is detected
Browse files Browse the repository at this point in the history
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 5ae6fcc ("kconfig: fix line number in recursive inclusion
error message").

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
  • Loading branch information
Masahiro Yamada committed Mar 25, 2018
1 parent 29c434f commit e2c75e7
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/kconfig/tests/err_recursive_inc/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source "Kconfig.inc1"
4 changes: 4 additions & 0 deletions scripts/kconfig/tests/err_recursive_inc/Kconfig.inc1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@



source "Kconfig.inc2"
3 changes: 3 additions & 0 deletions scripts/kconfig/tests/err_recursive_inc/Kconfig.inc2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@


source "Kconfig.inc3"
1 change: 1 addition & 0 deletions scripts/kconfig/tests/err_recursive_inc/Kconfig.inc3
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source "Kconfig.inc1"
10 changes: 10 additions & 0 deletions scripts/kconfig/tests/err_recursive_inc/__init__.py
Original file line number Diff line number Diff line change
@@ -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')
5 changes: 5 additions & 0 deletions scripts/kconfig/tests/err_recursive_inc/expected_stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Kconfig.inc1:4: recursive inclusion detected. Inclusion path:
current file : 'Kconfig.inc1'
included from: 'Kconfig.inc3:1'
included from: 'Kconfig.inc2:3'
included from: 'Kconfig.inc1:4'

0 comments on commit e2c75e7

Please sign in to comment.