testsuite: Exit with non-zero exit code when tests fail
authorBen Gamari <ben@smart-cactus.org>
Thu, 14 Dec 2017 22:08:36 +0000 (17:08 -0500)
committerBen Gamari <ben@smart-cactus.org>
Mon, 18 Dec 2017 16:32:30 +0000 (11:32 -0500)
testsuite/driver/runtests.py

index db17f3b..74a152e 100644 (file)
@@ -323,7 +323,14 @@ else:
     if args.junit:
         junit(t).write(args.junit)
 
-cleanup_and_exit(0)
+if len(t.unexpected_failures) > 0 or \
+   len(t.unexpected_stat_failures) > 0 or \
+   len(t.framework_failures) > 0:
+    exitcode = 1
+else:
+    exitcode = 0
+
+cleanup_and_exit(exitcode)
 
 # Note [Running tests in /tmp]
 #