summaryrefslogtreecommitdiff
path: root/testsuite.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-05-01 06:33:32 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-05-01 07:53:08 +0200
commited3ceaa05626fb62f50508843fdbf738bf6c2c64 (patch)
tree99ad2291acb363e1393d8523a331e1c35d0f70fc /testsuite.py
parent8f45a283a3a5dd31c462e39b524b8d5bd211d172 (diff)
Make warnings available in a list
Also make printing of warnings to stderr optional. It's on by default, since it's almost always what you want. This makes printing and processing of warnings more flexible, compared to always printing warnings to stderr as soon as they're generated. It was inspired by wanting to promote certain warnings to errors in Zephyr, which previously required capturing stderr.
Diffstat (limited to 'testsuite.py')
-rw-r--r--testsuite.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/testsuite.py b/testsuite.py
index 9a2f1fc..fbc511b 100644
--- a/testsuite.py
+++ b/testsuite.py
@@ -728,7 +728,7 @@ choice
print("Testing Kconfig.__repr__()")
verify_repr(c, """
-<configuration with 15 symbols, main menu prompt "Linux Kernel Configuration", srctree not set, config symbol prefix "CONFIG_", warnings disabled, undef. symbol assignment warnings disabled, redundant symbol assignment warnings enabled>
+<configuration with 15 symbols, main menu prompt "Linux Kernel Configuration", srctree not set, config symbol prefix "CONFIG_", warnings disabled, printing of warnings to stderr enabled, undef. symbol assignment warnings disabled, redundant symbol assignment warnings enabled>
""")
os.environ["srctree"] = "srctree value"
@@ -736,11 +736,12 @@ choice
c = Kconfig("Kconfiglib/tests/Krepr", warn=False)
c.enable_warnings()
+ c.disable_stderr_warnings()
c.disable_redun_warnings()
c.enable_undef_warnings()
verify_repr(c, """
-<configuration with 15 symbols, main menu prompt "Linux Kernel Configuration", srctree "srctree value", config symbol prefix "CONFIG_ value", warnings enabled, undef. symbol assignment warnings enabled, redundant symbol assignment warnings disabled>
+<configuration with 15 symbols, main menu prompt "Linux Kernel Configuration", srctree "srctree value", config symbol prefix "CONFIG_ value", warnings enabled, printing of warnings to stderr disabled, undef. symbol assignment warnings enabled, redundant symbol assignment warnings disabled>
""")
os.environ.pop("srctree", None)
@@ -1908,6 +1909,8 @@ def test_sanity(conf, arch, srcarch):
conf.disable_undef_warnings()
conf.enable_warnings()
conf.disable_warnings()
+ conf.enable_stderr_warnings()
+ conf.disable_stderr_warnings()
conf.mainmenu_text
conf.unset_values()