From 132e579cb8e4bdd49eb057ea81f5f8528ff80cf9 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 6 Mar 2019 03:21:08 +0100 Subject: Give more helpful error messages when files are missing The current error message talks a lot about $srctree, but $srctree is seldom the culprit in practice. More common is 'source "$(SOME_ENV_VAR)/foo"`, where SOME_ENV_VAR hasn't been set. Include the complete 'source ...' line for missing Kconfig files, and mention unset environment variables as a hint. Only mention $srctree briefly. Also shorten the message when a .config can't be a found a bit. This message would usually only be seen when working directly with the library. --- testsuite.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'testsuite.py') diff --git a/testsuite.py b/testsuite.py index fbca36c..3301ed5 100644 --- a/testsuite.py +++ b/testsuite.py @@ -1059,7 +1059,7 @@ g Kconfig("tests/Krecursive1") except KconfigError as e: verify_equal(str(e), """ -tests/Krecursive2:1: Recursive 'source' of 'tests/Krecursive1' detected. Check that environment variables are set correctly. +tests/Krecursive2:1: recursive 'source' of 'tests/Krecursive1' detected. Check that environment variables are set correctly. Include path: tests/Krecursive1:1 tests/Krecursive2:1 @@ -1076,7 +1076,7 @@ tests/Krecursive2:1 try: Kconfig("tests/Kmissingsource") except KconfigError as e: - if "does not exist" not in str(e): + if "not found" not in str(e): fail("'source' with missing file raised wrong KconfigError") except: fail("'source' with missing file raised wrong exception") @@ -1086,7 +1086,7 @@ tests/Krecursive2:1 try: Kconfig("tests/Kmissingrsource") except KconfigError as e: - if "does not exist" not in str(e): + if "not found" not in str(e): fail("'rsource' with missing file raised wrong KconfigError") except: fail("'rsource' with missing file raised wrong exception") -- cgit v1.2.3