[commit: testsuite] master: When the testsuite is ^Ced, print the summary anyway (816fbcd)

Ian Lynagh igloo at earth.li
Sat Feb 2 21:06:19 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/816fbcd235dda239fec9df9f053fcb04ded74d43

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

commit 816fbcd235dda239fec9df9f053fcb04ded74d43
Author: Ian Lynagh <ian at well-typed.com>
Date:   Sat Feb 2 19:04:18 2013 +0000

    When the testsuite is ^Ced, print the summary anyway

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

 driver/runtests.py |    4 ++++
 driver/testlib.py  |   15 ++++++++++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/driver/runtests.py b/driver/runtests.py
index 66e3bf4..f6581db 100644
--- a/driver/runtests.py
+++ b/driver/runtests.py
@@ -261,6 +261,8 @@ for file in t_files:
 if config.use_threads:
     t.running_threads=0
 for oneTest in parallelTests:
+    if stopping():
+        break
     oneTest()
 if config.use_threads:
     t.thread_pool.acquire()
@@ -269,6 +271,8 @@ if config.use_threads:
     t.thread_pool.release()
 config.use_threads = False
 for oneTest in aloneTests:
+    if stopping():
+        break
     oneTest()
         
 summary(t, sys.stdout)
diff --git a/driver/testlib.py b/driver/testlib.py
index 40ecf86..9f1f759 100644
--- a/driver/testlib.py
+++ b/driver/testlib.py
@@ -32,6 +32,14 @@ if config.use_threads:
     import threading
     import thread
 
+global wantToStop
+wantToStop = False
+def stopNow():
+    global wantToStop
+    wantToStop = True
+def stopping():
+    return wantToStop
+
 # Options valid for all the tests in the current "directory".  After
 # each test, we reset the options to these.  To change the options for
 # multiple tests, the function setTestOpts() below can be used to alter
@@ -726,6 +734,8 @@ def test_common_work (name, opts, func, args):
         if not config.clean_only:
             # Run the required tests...
             for way in do_ways:
+                if stopping():
+                    break
                 do_test (name, way, func, args)
 
             for way in all_ways:
@@ -888,7 +898,7 @@ def do_test(name, way, func, args):
         else:
             framework_fail(name, way, 'bad result ' + passFail)
     except KeyboardInterrupt:
-        raise
+        stopNow()
     except:
         framework_fail(name, way, 'do_test exception')
         traceback.print_exc()
@@ -2249,6 +2259,9 @@ def summary(t, file):
     if config.check_files_written:
         checkForFilesWrittenProblems(file)
 
+    if stopping():
+        file.write('WARNING: Testsuite run was terminated early\n')
+
 def printPassingTestInfosSummary(file, testInfos):
     directories = testInfos.keys()
     directories.sort()





More information about the ghc-commits mailing list