From 91328a5eb422e0aed4a3bf2f99a08d3aaefd07dd Mon Sep 17 00:00:00 2001 From: Mrx Date: Mon, 21 Sep 2026 02:26:24 +0530 Subject: [PATCH] Propagate test results to exit status in check-zenmap zenmap/test/run_tests.py discarded the TestResult, so the script always exited 0 and 'make check-zenmap' reported success even when tests failed or modules failed to import. Exit nonzero when the suite is unsuccessful, and also exit 1 (not 0) when unittest discovery itself is unavailable. Fixes #3469. --- zenmap/test/run_tests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zenmap/test/run_tests.py b/zenmap/test/run_tests.py index befb33892..6eb2869ed 100644 --- a/zenmap/test/run_tests.py +++ b/zenmap/test/run_tests.py @@ -7,11 +7,12 @@ if __name__ == "__main__": import os if not hasattr(unittest.defaultTestLoader, "discover"): print("Python unittest discovery missing. Requires Python 3.0 or newer.") # noqa - sys.exit(0) + sys.exit(1) os.chdir("..") suite = unittest.defaultTestLoader.discover( start_dir=".", pattern="*.py" ) - unittest.TextTestRunner().run(suite) + result = unittest.TextTestRunner().run(suite) + sys.exit(not result.wasSuccessful())