[commit: testsuite] master: Add 'make list_brokens' (7e6d754)

Ian Lynagh igloo at earth.li
Mon Feb 11 17:34:28 CET 2013


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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/7e6d754e901ef101a7417e1d48631b2b228b7911

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

commit 7e6d754e901ef101a7417e1d48631b2b228b7911
Author: Ian Lynagh <ian at well-typed.com>
Date:   Mon Feb 11 13:27:58 2013 +0000

    Add 'make list_brokens'
    
    Gives a list of tickets that the testsuite thinks are broken, and
    what bug it thinks is the reason. This can then be pasted into trac
    and 'previewed', which will show any closed tickets with strikeout.

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

 driver/runtests.py    |   49 +++++++++++++++++++++++++++----------------------
 driver/testglobals.py |    6 ++++++
 driver/testlib.py     |    6 +++++-
 mk/test.mk            |   10 ++++++++++
 4 files changed, 48 insertions(+), 23 deletions(-)

diff --git a/driver/runtests.py b/driver/runtests.py
index 04d69b7..b736ae5 100644
--- a/driver/runtests.py
+++ b/driver/runtests.py
@@ -254,28 +254,33 @@ for file in t_files:
         t.n_framework_failures = t.n_framework_failures + 1
         traceback.print_exc()
 
-# Now run all the tests
-if config.use_threads:
-    t.running_threads=0
-for oneTest in parallelTests:
-    if stopping():
-        break
-    oneTest()
-if config.use_threads:
-    t.thread_pool.acquire()
-    while t.running_threads>0:
-        t.thread_pool.wait()
-    t.thread_pool.release()
-config.use_threads = False
-for oneTest in aloneTests:
-    if stopping():
-        break
-    oneTest()
-        
-summary(t, sys.stdout)
-
-if config.output_summary != '':
-    summary(t, open(config.output_summary, 'w'))
+if config.list_broken:
+    global brokens
+    print 'Broken tests:'
+    print (' '.join(map (lambda (b, n) : '#' + str(b) + '(' + n + ')', brokens)))
+else:
+    # Now run all the tests
+    if config.use_threads:
+        t.running_threads=0
+    for oneTest in parallelTests:
+        if stopping():
+            break
+        oneTest()
+    if config.use_threads:
+        t.thread_pool.acquire()
+        while t.running_threads>0:
+            t.thread_pool.wait()
+        t.thread_pool.release()
+    config.use_threads = False
+    for oneTest in aloneTests:
+        if stopping():
+            break
+        oneTest()
+        
+    summary(t, sys.stdout)
+
+    if config.output_summary != '':
+        summary(t, open(config.output_summary, 'w'))
 
 sys.exit(0)
 
diff --git a/driver/testglobals.py b/driver/testglobals.py
index db99ef1..b7b6007 100644
--- a/driver/testglobals.py
+++ b/driver/testglobals.py
@@ -48,6 +48,8 @@ class TestConfig:
         # run the "fast" version of the test suite
         self.fast = 0
 
+        self.list_broken = False
+
         # Compiler type (ghc, hugs, nhc, etc.)
         self.compiler_type = ''
 
@@ -263,3 +265,7 @@ class TestOptions:
 global default_testopts
 default_testopts = TestOptions()
 
+# (bug, name) of tests marked broken
+global brokens
+brokens = []
+
diff --git a/driver/testlib.py b/driver/testlib.py
index e77c7d9..985a7b3 100644
--- a/driver/testlib.py
+++ b/driver/testlib.py
@@ -134,6 +134,8 @@ def expect_broken( bug ):
     return lambda name, opts, b=bug: _expect_broken (name, opts, b )
 
 def _expect_broken( name, opts, bug ):
+    global brokens
+    brokens.append((bug, name))
     opts.expect = 'fail';
 
 def ignore_output( name, opts ):
@@ -298,7 +300,9 @@ def skip_if_fast(name, opts):
 # -----
 
 def when(b, f):
-    if b:
+    # When list_brokens is on, we want to see all expect_broken calls,
+    # so we always do f
+    if b or config.list_broken:
         return f
     else:
         return normal
diff --git a/mk/test.mk b/mk/test.mk
index 6c974cc..e7604bd 100644
--- a/mk/test.mk
+++ b/mk/test.mk
@@ -175,6 +175,12 @@ endif
 RUNTEST_OPTS +=  \
 	$(EXTRA_RUNTEST_OPTS)
 
+ifeq "$(list_broken)" "YES"
+set_list_broken = -e config.list_broken=True
+else
+set_list_broken = 
+endif
+
 ifeq "$(fast)" "YES"
 setfast = -e config.fast=1
 else
@@ -209,6 +215,7 @@ test: $(TIMEOUT_PROGRAM)
 		$(patsubst %, --only=%, $(TESTS)) \
 		$(patsubst %, --way=%, $(WAY)) \
 		$(patsubst %, --skipway=%, $(SKIPWAY)) \
+		$(set_list_broken) \
 		$(setfast) \
 		$(setaccept)
 
@@ -220,3 +227,6 @@ accept:
 fast:
 	$(MAKE) fast=YES
 
+list_broken:
+	$(MAKE) list_broken=YES
+





More information about the ghc-commits mailing list