From: Daniel Veillard Date: Wed, 6 Feb 2002 10:35:19 +0000 (+0000) Subject: refactored make tests, make all now don't run the test suite added tests X-Git-Tag: v1.1.28~1033 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac6924c939da9b0655f372f168c39cc657e01423;p=platform%2Fupstream%2Flibxslt.git refactored make tests, make all now don't run the test suite added tests * Makefile.am configure.in tests/Makefile.am tests/*/Makefile.am tests/*/*/Makefile.am: refactored make tests, make all now don't run the test suite * python/Makefile.am: added tests * python/tests/basic.py python/tests/Makefile.am: added the first basic test, memory debug included Daniel --- diff --git a/ChangeLog b/ChangeLog index 1001199..1f9b72a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Wed Feb 6 11:29:31 CET 2002 Daniel Veillard + + * Makefile.am configure.in tests/Makefile.am tests/*/Makefile.am + tests/*/*/Makefile.am: refactored make tests, make all now don't + run the test suite + * python/Makefile.am: added tests + * python/tests/basic.py python/tests/Makefile.am: added the first + basic test, memory debug included + Wed Feb 6 00:20:57 CET 2002 Daniel Veillard * configure.in python/Makefile.am: attempst to tweak to get diff --git a/Makefile.am b/Makefile.am index 19b7d07..f578bc0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -50,7 +50,8 @@ check-local: tests dummy: tests: dummy - @(cd tests ; $(MAKE) test) + @(cd tests ; $(MAKE) tests) + @(cd python ; $(MAKE) tests) cleantar: @(rm -f libxslt*.tar.gz) diff --git a/configure.in b/configure.in index 9f17445..d4cde63 100644 --- a/configure.in +++ b/configure.in @@ -385,6 +385,7 @@ libexslt/Makefile libexslt/exsltconfig.h xsltproc/Makefile python/Makefile +python/tests/Makefile tests/Makefile tests/docs/Makefile tests/REC1/Makefile diff --git a/python/Makefile.am b/python/Makefile.am index 6d62d51..3a4d415 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -1,4 +1,4 @@ -# SUBDIRS= . tests +SUBDIRS= . tests LIBS=-L../libxslt/.libs -L../libxslt -lxslt -L../libexslt/.libs -L../libexslt -lexslt $(PYTHON_SITE_PACKAGES)/_libxml.so $(LIBXML_LIBS) INCLUDES=-I/usr/include/python$(PYTHON_VERSION) -I$(PYTHON_INCLUDES) $(LIBXML_CFLAGS) -I$(top_srcdir) @@ -61,7 +61,7 @@ GENERATED= $(srcdir)/libxsltclass.py \ $(GENERATED): $(srcdir)/$(GENERATE) $(API_DESC) cd $(srcdir) && $(PYTHON) $(GENERATE) -tests: all +tests test: all cd tests && $(MAKE) tests clean: diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am new file mode 100644 index 0000000..381844d --- /dev/null +++ b/python/tests/Makefile.am @@ -0,0 +1,27 @@ +EXAMPLE_DIR = $(prefix)/share/doc/libxslt-python-$(LIBXML_VERSION)/examples + +TESTS= \ + basic.py + +XMLS= \ + test.xml \ + test.xsl + +EXTRA_DIST = $(TESTS) $(XMLS) + +if WITH_PYTHON +tests: $(TESTS) + -@(PYTHONPATH=".." ; export PYTHONPATH; \ + for test in $(TESTS) ; do echo "-- $$test" ; $(PYTHON) $$test ; done) +else +tests: +endif + +clean: + rm -f *.pyc core + +install-data-local: + $(mkinstalldirs) $(DESTDIR)$(EXAMPLE_DIR) + -(for test in $(TESTS) $(XMLS); \ + do @INSTALL@ -m 0644 $$test $(DESTDIR)$(EXAMPLE_DIR) ; done) + diff --git a/python/tests/basic.py b/python/tests/basic.py new file mode 100755 index 0000000..40a649e --- /dev/null +++ b/python/tests/basic.py @@ -0,0 +1,25 @@ +#!/usr/bin/python -u +import libxml2 +import libxslt + +# Memory debug specific +libxml2.debugMemory(1) + + +styledoc = libxml2.parseFile("test.xsl") +style = libxslt.parseStylesheetDoc(styledoc) +doc = libxml2.parseFile("test.xml") +result = style.applyStylesheet(doc, None) +style.saveResultToFilename("foo", result, 0) +style = None +doc.freeDoc() +result.freeDoc() + +# Memory debug specific +libxslt.cleanupGlobals() +libxml2.cleanupParser() +if libxml2.debugMemory(1) == 0: + print "OK" +else: + print "Memory leak %d bytes" % (libxml2.debugMemory(1)) + libxml2.dumpMemory() diff --git a/python/tests/test.py b/python/tests/test.py deleted file mode 100755 index 27d9326..0000000 --- a/python/tests/test.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/python -u -import libxml2 -import libxslt - -styledoc = libxml2.parseFile("test.xsl") -style = libxslt.parseStylesheetDoc(styledoc) -doc = libxml2.parseFile("test.xml") -result = style.applyStylesheet(doc, None) -result.saveFile("-") diff --git a/tests/Makefile.am b/tests/Makefile.am index d2fcb29..f039409 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -5,8 +5,11 @@ SUBDIRS=docs REC1 REC2 REC general namespaces numbers documents \ all: -test tests: all docbook_tests +test tests: + @(cur=`pwd` ; for dir in $(SUBDIRS) ; do cd $$dir ; make tests ; cd $$cur ; done) + +full: tests docbook_tests docbook_tests: - @(cd docbook ; $(MAKE) tests) + @(cd docbook ; $(MAKE) full) diff --git a/tests/REC/Makefile.am b/tests/REC/Makefile.am index 020bd60..69e7e64 100644 --- a/tests/REC/Makefile.am +++ b/tests/REC/Makefile.am @@ -72,7 +72,7 @@ EXTRA_DIST = \ stand-2.7-1.out stand-2.7-1.xml -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump) diff --git a/tests/REC1/Makefile.am b/tests/REC1/Makefile.am index cb287f0..7ccac9f 100644 --- a/tests/REC1/Makefile.am +++ b/tests/REC1/Makefile.am @@ -5,7 +5,7 @@ $(top_builddir)/xsltproc/xsltproc: EXTRA_DIST = doc.xsl doc.xml doc.dtd result.xml -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump) diff --git a/tests/REC2/Makefile.am b/tests/REC2/Makefile.am index c047f68..31b1dcf 100644 --- a/tests/REC2/Makefile.am +++ b/tests/REC2/Makefile.am @@ -5,7 +5,7 @@ $(top_builddir)/xsltproc/xsltproc: EXTRA_DIST = data.xml vrml.xsl vrml.xml svg.xsl svg.xml html.xsl html.xml -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump) diff --git a/tests/XSLTMark/Makefile.am b/tests/XSLTMark/Makefile.am index 7db4e06..c29f702 100644 --- a/tests/XSLTMark/Makefile.am +++ b/tests/XSLTMark/Makefile.am @@ -50,7 +50,10 @@ EXTRA_DIST = \ $(top_builddir)/xsltproc/xsltproc: @(cd ../../xsltproc ; $(MAKE) xsltproc) -all: alphabetize attsets avts axis backwards bottles breadth brutal chart \ +all: + +tests test: \ + alphabetize attsets avts axis backwards bottles breadth brutal chart \ creation current dbonerow dbtail decoy depth encrypt functions game \ html identity inventory metric number oddtemplate patterns prettyprint \ priority products queens reverser stringsort summarize total tower trend \ diff --git a/tests/docbook/Makefile.am b/tests/docbook/Makefile.am index 8d876e8..8984e22 100644 --- a/tests/docbook/Makefile.am +++ b/tests/docbook/Makefile.am @@ -1,13 +1,15 @@ ## Process this file with automake to produce Makefile.in -all: single xtchunk # Avoid doing the test in normal pass +all: + +tests: single xtchunk # Avoid doing the test in normal pass $(top_builddir)/xsltproc/xsltproc: @(cd ../../xsltproc ; $(MAKE) xsltproc) EXTRA_DIST = README VERSION -tests: htmltests xhtmltests fotests +full: tests htmltests xhtmltests fotests # # a single tests to check that stuff ain't broken diff --git a/tests/documents/Makefile.am b/tests/documents/Makefile.am index 163b983..c7877a4 100644 --- a/tests/documents/Makefile.am +++ b/tests/documents/Makefile.am @@ -10,7 +10,7 @@ EXTRA_DIST = bredfort.css index.xml system.xml \ message.xml message.xsl message.result -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump) diff --git a/tests/exslt/Makefile.am b/tests/exslt/Makefile.am index b9d7666..b3ecdfa 100644 --- a/tests/exslt/Makefile.am +++ b/tests/exslt/Makefile.am @@ -4,4 +4,5 @@ SUBDIRS=common functions math sets strings all: -test tests: all +test tests: + @(cur=`pwd` ; for dir in $(SUBDIRS) ; do cd $$dir ; make tests ; cd $$cur ; done) diff --git a/tests/exslt/common/Makefile.am b/tests/exslt/common/Makefile.am index 00da00b..f97db89 100644 --- a/tests/exslt/common/Makefile.am +++ b/tests/exslt/common/Makefile.am @@ -9,7 +9,7 @@ EXTRA_DIST = \ node-set.3.xml node-set.3.xsl node-set.3.out \ object-type.1.xml object-type.1.xsl object-type.1.out -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump) diff --git a/tests/exslt/functions/Makefile.am b/tests/exslt/functions/Makefile.am index e7a5bf6..e75e5b9 100644 --- a/tests/exslt/functions/Makefile.am +++ b/tests/exslt/functions/Makefile.am @@ -11,7 +11,7 @@ EXTRA_DIST = \ function.5.out function.5.xml function.5.xsl \ function.6.out function.6.xml function.6.xsl -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump) diff --git a/tests/exslt/math/Makefile.am b/tests/exslt/math/Makefile.am index 01e4fb2..dc661aa 100644 --- a/tests/exslt/math/Makefile.am +++ b/tests/exslt/math/Makefile.am @@ -15,7 +15,7 @@ EXTRA_DIST = \ min.1.out min.1.xml min.1.xsl \ min.2.out min.2.xml min.2.xsl -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump) diff --git a/tests/exslt/sets/Makefile.am b/tests/exslt/sets/Makefile.am index e031682..8b0b981 100644 --- a/tests/exslt/sets/Makefile.am +++ b/tests/exslt/sets/Makefile.am @@ -10,7 +10,7 @@ EXTRA_DIST = \ leading.1.out leading.1.xml leading.1.xsl \ trailing.1.out trailing.1.xml trailing.1.xsl -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump) diff --git a/tests/exslt/strings/Makefile.am b/tests/exslt/strings/Makefile.am index 07c4a96..78eb8b1 100644 --- a/tests/exslt/strings/Makefile.am +++ b/tests/exslt/strings/Makefile.am @@ -6,7 +6,7 @@ $(top_builddir)/xsltproc/xsltproc: EXTRA_DIST = \ tokenize.1.xml tokenize.1.xsl tokenize.1.out -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump) diff --git a/tests/extensions/Makefile.am b/tests/extensions/Makefile.am index 12ec721..2710ee7 100644 --- a/tests/extensions/Makefile.am +++ b/tests/extensions/Makefile.am @@ -8,7 +8,7 @@ EXTRA_DIST = \ list.xml list.xsl list.out -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump) diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am index 795e1cc..8e538be 100644 --- a/tests/general/Makefile.am +++ b/tests/general/Makefile.am @@ -80,7 +80,7 @@ EXTRA_DIST = \ inner.xsl -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump) diff --git a/tests/multiple/Makefile.am b/tests/multiple/Makefile.am index 9f890ad..deea560 100644 --- a/tests/multiple/Makefile.am +++ b/tests/multiple/Makefile.am @@ -28,7 +28,7 @@ GENERATED = \ out/letterw.html out/letterx.html out/lettery.html out/letterz.html \ out/titlepage.html -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump) diff --git a/tests/namespaces/Makefile.am b/tests/namespaces/Makefile.am index 1e31b31..c04d1d1 100644 --- a/tests/namespaces/Makefile.am +++ b/tests/namespaces/Makefile.am @@ -10,7 +10,7 @@ EXTRA_DIST = \ extra.out extra.xml extra.xsl \ extra2.out extra2.xml extra2.xsl -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump) diff --git a/tests/numbers/Makefile.am b/tests/numbers/Makefile.am index a468c83..474c83c 100644 --- a/tests/numbers/Makefile.am +++ b/tests/numbers/Makefile.am @@ -5,7 +5,7 @@ $(top_builddir)/xsltproc/xsltproc: EXTRA_DIST = format-number.xsl format-number.xml format-number.out -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump) diff --git a/tests/reports/Makefile.am b/tests/reports/Makefile.am index 4dffa03..9851cb8 100644 --- a/tests/reports/Makefile.am +++ b/tests/reports/Makefile.am @@ -9,7 +9,7 @@ EXTRA_DIST = \ undefvar.xml undefvar.xsl undefvar.out undefvar.err -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump) diff --git a/tests/xmlspec/Makefile.am b/tests/xmlspec/Makefile.am index 8f5d817..85553d9 100644 --- a/tests/xmlspec/Makefile.am +++ b/tests/xmlspec/Makefile.am @@ -7,7 +7,7 @@ EXTRA_DIST = REC-xml-20001006.xml xmlspec-v21.dtd W3C-REC.css \ logo-REC xmlspec.xsl REC-xml-2e.xsl diffspec.xsl \ REC-xml-20001006.html REC-xml-20001006-review.html -all: test +all: test tests: $(top_builddir)/xsltproc/xsltproc @(echo > .memdump)