diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-03-13 12:12:12 +0300 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-03-25 20:04:05 +0300 |
commit | e2c75e7667c737148de6cdd522edf2163b4c61d3 (patch) | |
tree | a677f9e700354f0315161f271fbc9f37d9071af2 /scripts/kconfig/tests | |
parent | 29c434f367ea7b95bea7057105507c05abdc1297 (diff) | |
download | linux-e2c75e7667c737148de6cdd522edf2163b4c61d3.tar.xz |
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 5ae6fcc4bb82 ("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>
Diffstat (limited to 'scripts/kconfig/tests')
6 files changed, 24 insertions, 0 deletions
diff --git a/scripts/kconfig/tests/err_recursive_inc/Kconfig b/scripts/kconfig/tests/err_recursive_inc/Kconfig new file mode 100644 index 000000000000..0e4c8750ab65 --- /dev/null +++ b/scripts/kconfig/tests/err_recursive_inc/Kconfig @@ -0,0 +1 @@ +source "Kconfig.inc1" diff --git a/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc1 b/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc1 new file mode 100644 index 000000000000..00e408d653fc --- /dev/null +++ b/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc1 @@ -0,0 +1,4 @@ + + + +source "Kconfig.inc2" diff --git a/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc2 b/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc2 new file mode 100644 index 000000000000..349ea2db15dc --- /dev/null +++ b/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc2 @@ -0,0 +1,3 @@ + + +source "Kconfig.inc3" diff --git a/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc3 b/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc3 new file mode 100644 index 000000000000..0e4c8750ab65 --- /dev/null +++ b/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc3 @@ -0,0 +1 @@ +source "Kconfig.inc1" 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 000000000000..0e4c839c54aa --- /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 000000000000..a15dbedd253a --- /dev/null +++ b/scripts/kconfig/tests/err_recursive_inc/expected_stderr @@ -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' |