diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2004-03-22 19:10:02 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2004-03-22 19:10:02 +0000 |
commit | 6dc91962d072fd434fec4673e9e4f2201a99df86 (patch) | |
tree | b7e2a3faa7c11f10626af75b65984127aa96e346 /check-relaxng-test-suite.py | |
parent | 500a1de533e2ea03f452844f537bb247b7e43af2 (diff) | |
download | android_external_libxml2-6dc91962d072fd434fec4673e9e4f2201a99df86.tar.gz android_external_libxml2-6dc91962d072fd434fec4673e9e4f2201a99df86.tar.bz2 android_external_libxml2-6dc91962d072fd434fec4673e9e4f2201a99df86.zip |
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
Diffstat (limited to 'check-relaxng-test-suite.py')
-rwxr-xr-x | check-relaxng-test-suite.py | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/check-relaxng-test-suite.py b/check-relaxng-test-suite.py index 2e378f45..08327583 100755 --- a/check-relaxng-test-suite.py +++ b/check-relaxng-test-suite.py @@ -11,6 +11,7 @@ import libxml2 libxml2.debugMemory(1) debug = 0 verbose = 0 +quiet = 1 # # the testsuite description @@ -44,6 +45,8 @@ resources = {} 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_testCase(node): 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 @@ def handle_testSuite(node, level = 0): 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 @@ root = testsuite.getRootElement() 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 @@ testsuite.freeDoc() 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() |