diff --git a/scripts/tools/zap/test_generate.py b/scripts/tools/zap/test_generate.py index ff7ea2c20e74c2..d0ada5c22577b4 100755 --- a/scripts/tools/zap/test_generate.py +++ b/scripts/tools/zap/test_generate.py @@ -197,7 +197,9 @@ def process_arguments(): PROGRAM_ARGUMENTS = process_args - unittest.main(argv=unittest_args) + test_results = unittest.main(argv=unittest_args, exit=False) + if test_results.result.failures: + sys.exit(1) if process_args.stamp_file: open(process_args.stamp_file, "wb").close()