[commit: testsuite] master: Show directories in testsuite summary; partially fixes #5024 (e3c6d37)
Ian Lynagh
igloo at earth.li
Thu Jun 16 03:34:47 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/e3c6d37e230fbe9c28fa919172e89c0164748794
>---------------------------------------------------------------
commit e3c6d37e230fbe9c28fa919172e89c0164748794
Author: Ian Lynagh <igloo at earth.li>
Date: Wed Jun 15 21:58:27 2011 +0100
Show directories in testsuite summary; partially fixes #5024
>---------------------------------------------------------------
driver/testlib.py | 47 +++++++++++++++++++++++++++--------------------
1 files changed, 27 insertions(+), 20 deletions(-)
diff --git a/driver/testlib.py b/driver/testlib.py
index e87f9bc..1ef04e7 100644
--- a/driver/testlib.py
+++ b/driver/testlib.py
@@ -646,19 +646,13 @@ def do_test(name, way, func, args):
else:
print '*** unexpected pass for', full_name
t.n_unexpected_passes = t.n_unexpected_passes + 1
- if name in t.unexpected_passes:
- t.unexpected_passes[name].append(way)
- else:
- t.unexpected_passes[name] = [way]
+ addTestInfo(t.unexpected_passes, getTestOpts().testdir, name, way)
else:
if getTestOpts().expect == 'pass' \
and way not in getTestOpts().expect_fail_for:
print '*** unexpected failure for', full_name
t.n_unexpected_failures = t.n_unexpected_failures + 1
- if name in t.unexpected_failures:
- t.unexpected_failures[name].append(way)
- else:
- t.unexpected_failures[name] = [way]
+ addTestInfo(t.unexpected_failures, getTestOpts().testdir, name, way)
else:
t.n_expected_failures = t.n_expected_failures + 1
if name in t.expected_failures:
@@ -669,6 +663,17 @@ def do_test(name, way, func, args):
framework_fail(name, way, 'do_test exception')
traceback.print_exc()
+def addTestInfo (testInfos, directory, name, way):
+ directory = re.sub('^\\.[/\\\\]', '', directory)
+
+ if not directory in testInfos:
+ testInfos[directory] = {}
+
+ if not name in testInfos[directory]:
+ testInfos[directory][name] = []
+
+ testInfos[directory][name].append(way)
+
def skiptest (name, way):
# print 'Skipping test \"', name, '\"'
t.n_tests_skipped = t.n_tests_skipped + 1
@@ -1577,21 +1582,23 @@ def summary(t, file):
if t.n_unexpected_passes > 0:
file.write('Unexpected passes:\n')
- keys = t.unexpected_passes.keys()
- keys.sort()
- for test in keys:
- file.write(' ' + test + '(' + \
- join(t.unexpected_passes[test],',') + ')\n')
- file.write('\n')
+ printTestInfosSummary(file, t.unexpected_passes)
if t.n_unexpected_failures > 0:
file.write('Unexpected failures:\n')
- keys = t.unexpected_failures.keys()
- keys.sort()
- for test in keys:
- file.write(' ' + test + '(' + \
- join(t.unexpected_failures[test],',') + ')\n')
- file.write('\n')
+ printTestInfosSummary(file, t.unexpected_failures)
+
+def printTestInfosSummary(file, testInfos):
+ directories = testInfos.keys()
+ directories.sort()
+ maxDirLen = max(map ((lambda x : len(x)), directories))
+ for directory in directories:
+ tests = testInfos[directory].keys()
+ tests.sort()
+ for test in tests:
+ file.write(' ' + directory.ljust(maxDirLen + 2) + test + \
+ ' (' + join(testInfos[directory][test],',') + ')\n')
+ file.write('\n')
def getStdout(cmd):
if have_subprocess:
More information about the Cvs-ghc
mailing list