From 09deb06614c3408ec0816a3c88920138bae2083c Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 10 Sep 2004 05:26:00 +0000 Subject: Load /tmp/tmp.BmUFjT/libxml2-2.6.13 into packages/libxml2/branches/upstream/current. --- python/tests/Makefile.am | 3 ++- python/tests/Makefile.in | 7 ++++++- python/tests/schema.py | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100755 python/tests/schema.py (limited to 'python/tests') diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am index 259a1bf..722e0ec 100644 --- a/python/tests/Makefile.am +++ b/python/tests/Makefile.am @@ -32,6 +32,7 @@ PYTESTS= \ ctxterror.py\ readererr.py\ relaxng.py \ + schema.py \ thread2.py \ sync.py \ tstLastError.py \ @@ -46,7 +47,7 @@ EXTRA_DIST = $(PYTESTS) $(XMLS) if WITH_PYTHON tests: $(PYTESTS) - echo "## running Python regression tests" + @echo "## running Python regression tests" -@(PYTHONPATH="..:../.libs:$(srcdir)/..:$$PYTHONPATH" ; \ export PYTHONPATH; \ for test in $(PYTESTS) ; \ diff --git a/python/tests/Makefile.in b/python/tests/Makefile.in index f5e50ec..dfef491 100644 --- a/python/tests/Makefile.in +++ b/python/tests/Makefile.in @@ -69,6 +69,8 @@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ +CYGWIN_EXTRA_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ +CYGWIN_EXTRA_PYTHON_LIBADD = @CYGWIN_EXTRA_PYTHON_LIBADD@ DEBUG_OBJ = @DEBUG_OBJ@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -101,6 +103,7 @@ LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@ LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@ LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@ LIBXML_VERSION = @LIBXML_VERSION@ +LIBXML_VERSION_EXTRA = @LIBXML_VERSION_EXTRA@ LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@ LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@ LN_S = @LN_S@ @@ -118,6 +121,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PATTERN_TEST = @PATTERN_TEST@ +PERL = @PERL@ PYTHON = @PYTHON@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@ @@ -274,6 +278,7 @@ PYTESTS = \ ctxterror.py\ readererr.py\ relaxng.py \ + schema.py \ thread2.py \ sync.py \ tstLastError.py \ @@ -445,7 +450,7 @@ uninstall-am: uninstall-info-am @WITH_PYTHON_TRUE@tests: $(PYTESTS) -@WITH_PYTHON_TRUE@ echo "## running Python regression tests" +@WITH_PYTHON_TRUE@ @echo "## running Python regression tests" @WITH_PYTHON_TRUE@ -@(PYTHONPATH="..:../.libs:$(srcdir)/..:$$PYTHONPATH" ; \ @WITH_PYTHON_TRUE@ export PYTHONPATH; \ @WITH_PYTHON_TRUE@ for test in $(PYTESTS) ; \ diff --git a/python/tests/schema.py b/python/tests/schema.py new file mode 100755 index 0000000..bfa8423 --- /dev/null +++ b/python/tests/schema.py @@ -0,0 +1,52 @@ +#!/usr/bin/python -u +import libxml2 +import sys + +# Memory debug specific +libxml2.debugMemory(1) + +schema=""" + + + + + + + + + + + +""" + +instance=""" + + Raymond + G + Bayliss + +""" + +ctxt_parser = libxml2.schemaNewMemParserCtxt(schema, len(schema)) +ctxt_schema = ctxt_parser.schemaParse() +ctxt_valid = ctxt_schema.schemaNewValidCtxt() +doc = libxml2.parseDoc(instance) +ret = doc.schemaValidateDoc(ctxt_valid) +if ret != 0: + print "error doing schema validation" + sys.exit(1) + +doc.freeDoc() +del ctxt_parser +del ctxt_schema +del ctxt_valid +libxml2.schemaCleanupTypes() + +# Memory debug specific +libxml2.cleanupParser() +if libxml2.debugMemory(1) == 0: + print "OK" +else: + print "Memory leak %d bytes" % (libxml2.debugMemory(1)) + libxml2.dumpMemory() + -- cgit v1.2.3