mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-20 03:52:25 +03:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user