summaryrefslogtreecommitdiff
path: root/check-xinclude-test-suite.py
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2004-09-06 09:54:35 +0000
committerDaniel Veillard <veillard@src.gnome.org>2004-09-06 09:54:35 +0000
commit8b7967c3401ac9090cbcba45832eda6133334d7d (patch)
tree7d1d14e249d2658375dd0cbbfd6b245724a0844c /check-xinclude-test-suite.py
parent9d2674960caddbe45a1a536e7bb4b7f01247527c (diff)
downloadlibxml2-8b7967c3401ac9090cbcba45832eda6133334d7d.tar.gz
when output and expected do not match exactly run diff to put the
* check-xinclude-test-suite.py: when output and expected do not match exactly run diff to put the differences in the log c.f. #148691 Daniel
Diffstat (limited to 'check-xinclude-test-suite.py')
-rwxr-xr-xcheck-xinclude-test-suite.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/check-xinclude-test-suite.py b/check-xinclude-test-suite.py
index c0af1f97..163ea32c 100755
--- a/check-xinclude-test-suite.py
+++ b/check-xinclude-test-suite.py
@@ -82,6 +82,8 @@ def runTest(test, basedir):
return -1
expected = None
+ outputfile = None
+ diff = None
if type != 'error':
output = test.xpathEval('string(output)')
if output == 'No output file.':
@@ -98,6 +100,7 @@ def runTest(test, basedir):
try:
f = open(output)
expected = f.read()
+ outputfile = output
except:
print "Result for %s unreadable: %s" % (id, output)
@@ -112,6 +115,8 @@ def runTest(test, basedir):
result = doc.serialize()
if result != expected:
print "Result for %s differs" % (id)
+ open("xinclude.res", "w").write(result)
+ diff = os.popen("diff %s xinclude.res" % outputfile).read()
doc.freeDoc()
else:
@@ -157,6 +162,9 @@ def runTest(test, basedir):
log.write(" ----\n%s ----\n" % (error_msg))
error_msg = ''
log.write("\n")
+ if diff != None:
+ log.write("diff from test %s:\n" %(id))
+ log.write(" -----------\n%s\n -----------\n" % (diff));
return 0