#
# This is the MS subset of the W3C test suite for XML Schemas.
# This file is generated from the MS W3c test suite description file.
#
import libxml2
help="""The base directory; i.e. the parent folder of the
"nisttest", "suntest" and "msxsdtest" directories.""")
default=None,
default=None,
default=None,
default=None,
################################################
# The vars below are not intended to be changed.
#
###################
# Helper functions.
#
vendor = None
global options
return ""
return fileName
class XSTCTestGroup:
global vendor, vendorNIST_2
if not self.mainSchema:
return
class XSTCTestCase:
# <!-- groupName, Name, Accepted, File, Val, Descr
global options
#
# Constructor.
#
self.testRunner = None
self.combineName = None
#
# Init the log.
#
#
# Get the test-group.
#
#
# Use the last given directory for the combine name.
#
elif vendor == vendorNIST:
#
# NIST files are named in the following form:
# "NISTSchema-short-pattern-1.xsd"
#
elif vendor == vendorNIST_2:
#
# Group-names have the form: "atomic-normalizedString-length-1"
#
else:
raise Exception("Could not compute the combine name of a test.")
"""This one is intended to be used by the error handler
function"""
global options
global options
global options
global options
global options
global options
global options
#
# Set up Libxml2.
#
err = None
try:
except:
# Suppress exceptions.
pass
if (err is None):
return False
global options
if options.debugEnabled:
global options
"""Adds additional info to the log."""
#
# Add libxml2 messages.
#
#
# Add memory leaks.
#
"""Runs a test."""
global options
##filePath = os.path.join(options.baseDir, self.fileName)
# filePath = "%s/%s/%s/%s" % (options.baseDir, self.test_Folder, self.schema_Folder, self.schema_File)
try:
self.failExcept(e)
schema = None
try:
try:
except:
pass
finally:
del ctxt
return schema
schema = None
# os.path.join(options.baseDir, self.fileName)
valid = 0
try:
#
# Parse the schema.
#
if schema is None:
return
if (schema == None):
else:
else:
finally:
del schema
instance = None
schema = None
# os.path.join(options.baseDir, self.fileName)
return
if (parserCtxt is None):
# TODO: Is this one necessary, or will an exception
# be already raised?
raise Exception("Could not create the instance parser context.")
if not options.validationSAX:
try:
try:
except:
# Suppress exceptions.
pass
finally:
del parserCtxt
if instance is None:
return
try:
#
# Validate the instance.
#
try:
#validationCtxt = libxml2.schemaNewValidCtxt(None)
if (validationCtxt is None):
return
try:
if options.validationSAX:
else:
if (instance_Err != 0):
else:
else:
finally:
del validationCtxt
finally:
del schema
finally:
if instance is not None:
####################
# Test runner class.
#
class XSTCTestRunner:
self.combinesRan = {}
return counters
if test.unimplemented:
if test.internalErr:
if test.noSchemaErr:
return counters
if all:
elif combName is not None:
# out.write(" succeeded : %d\n" % counters[self.CNT_SUCCEEDED])
# out.write(" succeeded : %d\n" % counters[self.CNT_SUCCEEDED])
else:
global options
#
# Compute evaluation counters.
#
if options.reportErrCombines and (counters[self.CNT_FAILED] == 0) and (counters[self.CNT_MEMLEAK] == 0):
pass
else:
global options
#
# Only erroneous tests will be written to the log,
# except @verbose is switched on.
#
#
# if not @silent, only erroneous tests will be
# written to stdout, except @verbose is switched on.
#
if (options.verbose or error) and (not options.reportInternalErrOnly) and (not options.reportMemLeakErrOnly) and (not options.reportUnimplErrOnly):
else:
global options
return
try:
#
# Filter tests.
#
continue
continue
elif options.testStartsWith is not None:
continue
elif options.combineStartsWith is not None:
continue
break
#
# Run the thing, dammit.
#
try:
try:
finally:
finally:
#
# Evaluate.
#
finally:
#
# Build a report for every single combine.
#
# TODO: How to sort a dict?
#
#
# Display the final report.
#
else: