kconfig: tests: test if recursive inclusion is detected

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 5ae6fcc4bb ("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>
This commit is contained in:
Masahiro Yamada 2018-03-13 18:12:12 +09:00
parent 29c434f367
commit e2c75e7667
6 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1 @@
source "Kconfig.inc1"

View File

@ -0,0 +1,4 @@
source "Kconfig.inc2"

View File

@ -0,0 +1,3 @@
source "Kconfig.inc3"

View File

@ -0,0 +1 @@
source "Kconfig.inc1"

View File

@ -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')

View File

@ -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'