[PATCH] run-tests.py: Show paths to failing tests, .err and .out
Mads Kiilerich
mads at kiilerich.com
Wed Dec 16 05:09:59 CST 2009
# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1260961765 -3600
# Node ID 48a0b0fefd993f044068750f858d96dcd3e5fd9a
# Parent 97c75ad3b1a094742ae66b5de54e96d7f36f2816
run-tests.py: Show paths to failing tests, .err and .out
I think this is very convenient when investigating and fixing test failures,
but perhaps it must be tweaked further to show paths if and only if
it is appropriate.
diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -251,9 +251,8 @@
return missing, failed
-def showdiff(expected, output):
- for line in difflib.unified_diff(expected, output,
- "Expected output", "Test output"):
+def showdiff(expected, output, ref, err):
+ for line in difflib.unified_diff(expected, output, ref, err):
sys.stdout.write(line)
def findprogram(program):
@@ -452,13 +451,13 @@
if not options.verbose:
skips.append((test, msg))
else:
- print "\nSkipping %s: %s" % (test, msg)
+ print "\nSkipping %s: %s" % (testpath, msg)
return None
def fail(msg):
fails.append((test, msg))
if not options.nodiff:
- print "\nERROR: %s %s" % (test, msg)
+ print "\nERROR: %s %s" % (testpath, msg)
return None
vlog("# Test", test)
@@ -565,7 +564,7 @@
else:
fail("output changed")
if not options.nodiff:
- showdiff(refout, out)
+ showdiff(refout, out, ref, err)
ret = 1
elif ret:
mark = '!'
More information about the Mercurial-devel
mailing list