Commit 3d94d01a authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

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.
parent 98e12ea9
......@@ -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()
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)
summary(t, sys.stdout)
if config.output_summary != '':
summary(t, open(config.output_summary, 'w'))
if config.output_summary != '':
summary(t, open(config.output_summary, 'w'))
sys.exit(0)
......@@ -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 = []
......@@ -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
......
......@@ -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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment