-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kconfig: tests: test if recursive dependencies are detected
Recursive dependency should be detected and warned. Test this. This indirectly tests the line number increments. 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
3e4888c
commit 29c434f
Showing
3 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
""" | ||
Warn recursive inclusion. | ||
Recursive dependency should be warned. | ||
""" | ||
|
||
def test(conf): | ||
assert conf.oldaskconfig() == 0 | ||
assert conf.stderr_contains('expected_stderr') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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 |