import sys
import time
import os
import string
import libxml2
#
# the testsuite description
#
#
# Error and warning handlers
#
global error_nr
global error_msg
else:
global error_nr
global error_msg
global log
error_nr = 0
error_msg = ''
return 1
global test_nr
global test_failed
global test_error
global test_succeed
global error_msg
global log
fatal_error = 0
if uri == None:
print "Test without ID:", uri
return -1
if id == None:
print "Test without URI:", id
return -1
if type == None:
print "Test without URI:", id
return -1
if basedir != None:
else:
return -1
expected = None
outputfile = None
diff = None
if type != 'error':
if output == 'No output file.':
output = None
if output == '':
output = None
if output != None:
if basedir != None:
output = None
else:
try:
except:
try:
# print "testing %s" % (URI)
except:
doc = None
if doc != None:
print "Result for %s differs" % (id)
else:
print "Failed to parse %s" % (URI)
res = -1
if type == 'success':
if res > 0:
elif res == 0:
print "Test %s: no substitution done ???" % (id)
elif res < 0:
print "Test %s: failed valid XInclude processing" % (id)
elif type == 'error':
if res > 0:
print "Test %s: failed to detect invalid XInclude processing" % (id)
elif res == 0:
print "Test %s: Invalid but no substitution done" % (id)
elif res < 0:
elif type == 'optional':
if res > 0:
else:
print "Test %s: failed optional test" % (id)
# Log the ontext
if res != 1:
if error_msg != '':
error_msg = ''
if diff != None:
return 0
if creator != None:
print "=>", creator
if basedir != None:
while test != None:
if conf == None:
print "Unable to load %s" % CONF
print "Expecting TESTSUITE root element: aborting"
if profile != None:
print profile
while case != None:
print " Ran %d tests: %d suceeded, %d failed and %d generated an error" % (
print "Ran %d tests: %d suceeded, %d failed and %d generated an error in %.2f s." % (