[commit: ghc] master: testsuite: Exit with non-zero exit code when tests fail (0302439)

git at git.haskell.org git at git.haskell.org
Mon Dec 18 16:32:44 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/030243953d522f2f8185ae417869a94d5f86210f/ghc

>---------------------------------------------------------------

commit 030243953d522f2f8185ae417869a94d5f86210f
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Thu Dec 14 17:08:36 2017 -0500

    testsuite: Exit with non-zero exit code when tests fail


>---------------------------------------------------------------

030243953d522f2f8185ae417869a94d5f86210f
 testsuite/driver/runtests.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py
index db17f3b..74a152e 100644
--- a/testsuite/driver/runtests.py
+++ b/testsuite/driver/runtests.py
@@ -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]
 #



More information about the ghc-commits mailing list