refactored make tests, make all now don't run the test suite added tests
authorDaniel Veillard <veillard@src.gnome.org>
Wed, 6 Feb 2002 10:35:19 +0000 (10:35 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Wed, 6 Feb 2002 10:35:19 +0000 (10:35 +0000)
* 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

27 files changed:
ChangeLog
Makefile.am
configure.in
python/Makefile.am
python/tests/Makefile.am [new file with mode: 0644]
python/tests/basic.py [new file with mode: 0755]
python/tests/test.py [deleted file]
tests/Makefile.am
tests/REC/Makefile.am
tests/REC1/Makefile.am
tests/REC2/Makefile.am
tests/XSLTMark/Makefile.am
tests/docbook/Makefile.am
tests/documents/Makefile.am
tests/exslt/Makefile.am
tests/exslt/common/Makefile.am
tests/exslt/functions/Makefile.am
tests/exslt/math/Makefile.am
tests/exslt/sets/Makefile.am
tests/exslt/strings/Makefile.am
tests/extensions/Makefile.am
tests/general/Makefile.am
tests/multiple/Makefile.am
tests/namespaces/Makefile.am
tests/numbers/Makefile.am
tests/reports/Makefile.am
tests/xmlspec/Makefile.am

index 1001199..1f9b72a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Wed Feb  6 11:29:31 CET 2002 Daniel Veillard <daniel@veillard.com>
+
+       * 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 <daniel@veillard.com>
 
        * configure.in python/Makefile.am: attempst to tweak to get
index 19b7d07..f578bc0 100644 (file)
@@ -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)
index 9f17445..d4cde63 100644 (file)
@@ -385,6 +385,7 @@ libexslt/Makefile
 libexslt/exsltconfig.h
 xsltproc/Makefile
 python/Makefile
+python/tests/Makefile
 tests/Makefile
 tests/docs/Makefile
 tests/REC1/Makefile
index 6d62d51..3a4d415 100644 (file)
@@ -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 (file)
index 0000000..381844d
--- /dev/null
@@ -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 (executable)
index 0000000..40a649e
--- /dev/null
@@ -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 (executable)
index 27d9326..0000000
+++ /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("-")
index d2fcb29..f039409 100644 (file)
@@ -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)
 
index 020bd60..69e7e64 100644 (file)
@@ -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)
index cb287f0..7ccac9f 100644 (file)
@@ -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)
index c047f68..31b1dcf 100644 (file)
@@ -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)
index 7db4e06..c29f702 100644 (file)
@@ -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 \
index 8d876e8..8984e22 100644 (file)
@@ -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
index 163b983..c7877a4 100644 (file)
@@ -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)
index b9d7666..b3ecdfa 100644 (file)
@@ -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)
index 00da00b..f97db89 100644 (file)
@@ -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)
index e7a5bf6..e75e5b9 100644 (file)
@@ -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)
index 01e4fb2..dc661aa 100644 (file)
@@ -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)
index e031682..8b0b981 100644 (file)
@@ -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)
index 07c4a96..78eb8b1 100644 (file)
@@ -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)
index 12ec721..2710ee7 100644 (file)
@@ -8,7 +8,7 @@ EXTRA_DIST = \
     list.xml list.xsl list.out
 
 
-all: test
+all:
 
 test tests: $(top_builddir)/xsltproc/xsltproc
        @(echo > .memdump)
index 795e1cc..8e538be 100644 (file)
@@ -80,7 +80,7 @@ EXTRA_DIST = \
     inner.xsl
 
 
-all: test
+all:
 
 test tests: $(top_builddir)/xsltproc/xsltproc
        @(echo > .memdump)
index 9f890ad..deea560 100644 (file)
@@ -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)
index 1e31b31..c04d1d1 100644 (file)
@@ -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)
index a468c83..474c83c 100644 (file)
@@ -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)
index 4dffa03..9851cb8 100644 (file)
@@ -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)
index 8f5d817..85553d9 100644 (file)
@@ -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)