From 7dc5b74229e83876307082712162d48e3124e10b Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 17 Jan 2018 12:56:13 +0100 Subject: Detect recursive 'source' and print backtrace Easier to debug than a RecursionError. Point out in the exception message that a common cause is environment variables not being set correctly. --- testsuite.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'testsuite.py') diff --git a/testsuite.py b/testsuite.py index 8306c05..a876f0e 100644 --- a/testsuite.py +++ b/testsuite.py @@ -779,6 +779,17 @@ g verify_locations([c.syms["COMMENT_HOOK"].nodes[0].next], "tests/Klocation_included:15") + # Test recursive 'source' detection + + got_syntax_exception = False + try: + Kconfig("Kconfiglib/tests/Krecursive1") + except KconfigSyntaxError: + got_syntax_exception = True + + verify(got_syntax_exception, + "recursive 'source' did not raise KconfigSyntaxError") + print("Testing visibility") -- cgit v1.2.3