diff options
author | Mike Hommey <glandium@debian.org> | 2008-04-09 10:33:41 +0200 |
---|---|---|
committer | Mike Hommey <glandium@debian.org> | 2008-04-09 10:33:41 +0200 |
commit | 88f9c7ca80bfbc9a5429fc632b90d6c4a2a2787d (patch) | |
tree | e12ef38cd8eb205c495e5718852d758b95e3a3c6 /python/tests | |
parent | fc760252aba4054a612dd20b803d0c7c19713064 (diff) | |
download | libxml2-88f9c7ca80bfbc9a5429fc632b90d6c4a2a2787d.tar.gz |
Load /tmp/libxml2-2.6.32 intoupstream/2.6.32.dfsg
libxml2/branches/upstream/current.
Diffstat (limited to 'python/tests')
-rw-r--r-- | python/tests/Makefile.am | 18 | ||||
-rw-r--r-- | python/tests/Makefile.in | 71 | ||||
-rwxr-xr-x | python/tests/xpathns.py | 29 |
3 files changed, 80 insertions, 38 deletions
diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am index 5ba503a..8a85075 100644 --- a/python/tests/Makefile.am +++ b/python/tests/Makefile.am @@ -1,4 +1,5 @@ -EXAMPLE_DIR = $(datadir)/doc/libxml2-python-$(LIBXML_VERSION)/examples +exampledir = $(datadir)/doc/libxml2-python-$(LIBXML_VERSION)/examples +dist_example_DATA = $(PYTESTS) $(XMLS) PYTESTS= \ build.py \ @@ -44,7 +45,8 @@ PYTESTS= \ validDTD.py \ validSchemas.py \ validRNG.py \ - compareNodes.py + compareNodes.py \ + xpathns.py XMLS= \ tst.xml \ @@ -52,8 +54,6 @@ XMLS= \ invalid.xml \ test.dtd -EXTRA_DIST = $(PYTESTS) $(XMLS) - if WITH_PYTHON tests: $(PYTESTS) @echo "## running Python regression tests" @@ -71,13 +71,3 @@ endif clean: rm -f *.pyc core - -install-data-local: - $(mkinstalldirs) $(DESTDIR)$(EXAMPLE_DIR) - -(for test in $(PYTESTS) $(XMLS); \ - do @INSTALL@ -m 0644 $(srcdir)/$$test $(DESTDIR)$(EXAMPLE_DIR) ; done) - -uninstall-local: - @(for test in $(PYTESTS) $(XMLS) ; \ - do rm $(DESTDIR)$(EXAMPLE_DIR)/`basename $$test` ; done) - diff --git a/python/tests/Makefile.in b/python/tests/Makefile.in index d477970..914e222 100644 --- a/python/tests/Makefile.in +++ b/python/tests/Makefile.in @@ -13,6 +13,7 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -32,7 +33,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = python/tests -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(dist_example_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.in @@ -43,6 +45,15 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(exampledir)" +dist_exampleDATA_INSTALL = $(INSTALL_DATA) +DATA = $(dist_example_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -259,7 +270,8 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -EXAMPLE_DIR = $(datadir)/doc/libxml2-python-$(LIBXML_VERSION)/examples +exampledir = $(datadir)/doc/libxml2-python-$(LIBXML_VERSION)/examples +dist_example_DATA = $(PYTESTS) $(XMLS) PYTESTS = \ build.py \ attribs.py \ @@ -304,7 +316,8 @@ PYTESTS = \ validDTD.py \ validSchemas.py \ validRNG.py \ - compareNodes.py + compareNodes.py \ + xpathns.py XMLS = \ tst.xml \ @@ -312,7 +325,6 @@ XMLS = \ invalid.xml \ test.dtd -EXTRA_DIST = $(PYTESTS) $(XMLS) all: all-am .SUFFIXES: @@ -351,6 +363,23 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +install-dist_exampleDATA: $(dist_example_DATA) + @$(NORMAL_INSTALL) + test -z "$(exampledir)" || $(MKDIR_P) "$(DESTDIR)$(exampledir)" + @list='$(dist_example_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(dist_exampleDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(exampledir)/$$f'"; \ + $(dist_exampleDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(exampledir)/$$f"; \ + done + +uninstall-dist_exampleDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_example_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(exampledir)/$$f'"; \ + rm -f "$(DESTDIR)$(exampledir)/$$f"; \ + done tags: TAGS TAGS: @@ -386,8 +415,11 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile +all-am: Makefile $(DATA) installdirs: + for dir in "$(DESTDIR)$(exampledir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -428,7 +460,7 @@ info: info-am info-am: -install-data-am: install-data-local +install-data-am: install-dist_exampleDATA install-dvi: install-dvi-am @@ -462,21 +494,21 @@ ps: ps-am ps-am: -uninstall-am: uninstall-local +uninstall-am: uninstall-dist_exampleDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-data-local install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am uninstall-local + install-data install-data-am install-dist_exampleDATA \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am uninstall uninstall-am uninstall-dist_exampleDATA @WITH_PYTHON_TRUE@tests: $(PYTESTS) @@ -493,15 +525,6 @@ uninstall-am: uninstall-local clean: rm -f *.pyc core - -install-data-local: - $(mkinstalldirs) $(DESTDIR)$(EXAMPLE_DIR) - -(for test in $(PYTESTS) $(XMLS); \ - do @INSTALL@ -m 0644 $(srcdir)/$$test $(DESTDIR)$(EXAMPLE_DIR) ; done) - -uninstall-local: - @(for test in $(PYTESTS) $(XMLS) ; \ - do rm $(DESTDIR)$(EXAMPLE_DIR)/`basename $$test` ; done) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/python/tests/xpathns.py b/python/tests/xpathns.py new file mode 100755 index 0000000..e67e550 --- /dev/null +++ b/python/tests/xpathns.py @@ -0,0 +1,29 @@ +#!/usr/bin/python -u +# +import libxml2 + +expect=' xmlns:a="urn:whatevar"' + +# Memory debug specific +libxml2.debugMemory(1) + +d = libxml2.parseDoc("<a:a xmlns:a='urn:whatevar'/>") +res="" +for n in d.xpathEval("//namespace::*"): + res = res + n.serialize() +d.freeDoc() + +if res != expect: + print "test5 failed: unexpected output" + print res +del res +del d +del n +# Memory debug specific +libxml2.cleanupParser() + +if libxml2.debugMemory(1) == 0: + print "OK" +else: + print "Memory leak %d bytes" % (libxml2.debugMemory(1)) + libxml2.dumpMemory() |