diff mbox series

[v2,1/2] patchtest: return non-zero exit code on test failure

Message ID 20260401134533.322260-1-naftaly.ralamboarivony@smile.fr
State New
Headers show
Series [v2,1/2] patchtest: return non-zero exit code on test failure | expand

Commit Message

naftaly.ralamboarivony@smile.fr April 1, 2026, 1:45 p.m. UTC
From: Naftaly RALAMBOARIVONY <naftaly.ralamboarivony@smile.fr>

Update patchtest to return a non-zero exit code when a test fails
instead of always exiting successfully.

This enables proper failure detection in selftests and CI pipelines
relying on the command return status.

Signed-off-by: Naftaly RALAMBOARIVONY <naftaly.ralamboarivony@smile.fr>
---
changes in v2:
    - Removed the --error-on-failure option; if a test fails, a non-zero value is returned
---
 scripts/patchtest | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/scripts/patchtest b/scripts/patchtest
index 9218db232a..143cf08572 100755
--- a/scripts/patchtest
+++ b/scripts/patchtest
@@ -183,6 +183,7 @@  def print_result_message(preresult, postresult):
     print("----------------------------------------------------------------------\n")
 
 def main():
+    ret = 0
     tmp_patch = False
     patch_path = PatchtestParser.patch_path
     log_results = PatchtestParser.log_results
@@ -214,13 +215,15 @@  def main():
 
         try:
             if log_path:
-                run(patch, log_path)
+                ret = run(patch, log_path)
             else:
-                run(patch)
+                ret = run(patch)
         finally:
             if tmp_patch:
                 os.remove(patch)
 
+    return ret
+
 if __name__ == '__main__':
     ret = 1