remove a memory leak on schemas type facets. reduce verbosity incorporated
* relaxng.c: remove a memory leak on schemas type facets.
* check-relaxng-test-suite.py check-relaxng-test-suite2.py
check-xsddata-test-suite.py: reduce verbosity
* configure.in Makefile.am: incorporated the Python regressions
tests for Relax-NG and Schemas Datatype to "make tests"
Daniel
diff --git a/check-relaxng-test-suite.py b/check-relaxng-test-suite.py
index 2e378f4..0832758 100755
--- a/check-relaxng-test-suite.py
+++ b/check-relaxng-test-suite.py
@@ -11,6 +11,7 @@
libxml2.debugMemory(1)
debug = 0
verbose = 0
+quiet = 1
#
# the testsuite description
@@ -44,6 +45,8 @@
def resolver(URL, ID, ctxt):
global resources
+ if string.find(URL, '#') != -1:
+ URL = URL[0:string.find(URL, '#')]
if resources.has_key(URL):
return(StringIO.StringIO(resources[URL]))
log.write("Resolver failure: asked %s\n" % (URL))
@@ -306,6 +309,7 @@
def handle_testSuite(node, level = 0):
global nb_schemas_tests, nb_schemas_success, nb_schemas_failed
global nb_instances_tests, nb_instances_success, nb_instances_failed
+ global quiet
if level >= 1:
old_schemas_tests = nb_schemas_tests
old_schemas_success = nb_schemas_success
@@ -324,13 +328,15 @@
msg = msg + "written by "
for author in authors:
msg = msg + author.content + " "
- print msg
+ if quiet == 0:
+ print msg
sections = node.xpathEval('section')
if sections != [] and level <= 0:
msg = ""
for section in sections:
msg = msg + section.content + " "
- print "Tests for section %s" % (msg)
+ if quiet == 0:
+ print "Tests for section %s" % (msg)
for test in node.xpathEval('testCase'):
handle_testCase(test)
for test in node.xpathEval('testSuite'):
@@ -362,12 +368,17 @@
if root.name != 'testSuite':
print "%s doesn't start with a testSuite element, aborting" % (CONF)
sys.exit(1)
-print "Running Relax NG testsuite"
+if quiet == 0:
+ print "Running Relax NG testsuite"
handle_testSuite(root)
-print "\nTOTAL:\nfound %d test schemas: %d success %d failures" % (
+if quiet == 0:
+ print "\nTOTAL:\n"
+if quiet == 0 or nb_schemas_failed != 0:
+ print "found %d test schemas: %d success %d failures" % (
nb_schemas_tests, nb_schemas_success, nb_schemas_failed)
-print "found %d test instances: %d success %d failures" % (
+if quiet == 0 or nb_instances_failed != 0:
+ print "found %d test instances: %d success %d failures" % (
nb_instances_tests, nb_instances_success, nb_instances_failed)
testsuite.freeDoc()
@@ -376,7 +387,8 @@
libxml2.relaxNGCleanupTypes()
libxml2.cleanupParser()
if libxml2.debugMemory(1) == 0:
- print "OK"
+ if quiet == 0:
+ print "OK"
else:
print "Memory leak %d bytes" % (libxml2.debugMemory(1))
libxml2.dumpMemory()