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
This commit is contained in:
Daniel Veillard 2002-02-06 10:35:19 +00:00
parent f0cb070b69
commit ac6924c939
27 changed files with 97 additions and 34 deletions

View File

@ -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> Wed Feb 6 00:20:57 CET 2002 Daniel Veillard <daniel@veillard.com>
* configure.in python/Makefile.am: attempst to tweak to get * configure.in python/Makefile.am: attempst to tweak to get

View File

@ -50,7 +50,8 @@ check-local: tests
dummy: dummy:
tests: dummy tests: dummy
@(cd tests ; $(MAKE) test) @(cd tests ; $(MAKE) tests)
@(cd python ; $(MAKE) tests)
cleantar: cleantar:
@(rm -f libxslt*.tar.gz) @(rm -f libxslt*.tar.gz)

View File

@ -385,6 +385,7 @@ libexslt/Makefile
libexslt/exsltconfig.h libexslt/exsltconfig.h
xsltproc/Makefile xsltproc/Makefile
python/Makefile python/Makefile
python/tests/Makefile
tests/Makefile tests/Makefile
tests/docs/Makefile tests/docs/Makefile
tests/REC1/Makefile tests/REC1/Makefile

View 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) 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) 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) $(GENERATED): $(srcdir)/$(GENERATE) $(API_DESC)
cd $(srcdir) && $(PYTHON) $(GENERATE) cd $(srcdir) && $(PYTHON) $(GENERATE)
tests: all tests test: all
cd tests && $(MAKE) tests cd tests && $(MAKE) tests
clean: clean:

27
python/tests/Makefile.am Normal file
View File

@ -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)

25
python/tests/basic.py Executable file
View File

@ -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()

View File

@ -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("-")

View File

@ -5,8 +5,11 @@ SUBDIRS=docs REC1 REC2 REC general namespaces numbers documents \
all: 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: docbook_tests:
@(cd docbook ; $(MAKE) tests) @(cd docbook ; $(MAKE) full)

View File

@ -72,7 +72,7 @@ EXTRA_DIST = \
stand-2.7-1.out stand-2.7-1.xml stand-2.7-1.out stand-2.7-1.xml
all: test all:
test tests: $(top_builddir)/xsltproc/xsltproc test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)

View File

@ -5,7 +5,7 @@ $(top_builddir)/xsltproc/xsltproc:
EXTRA_DIST = doc.xsl doc.xml doc.dtd result.xml EXTRA_DIST = doc.xsl doc.xml doc.dtd result.xml
all: test all:
test tests: $(top_builddir)/xsltproc/xsltproc test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)

View 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 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 test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)

View File

@ -50,7 +50,10 @@ EXTRA_DIST = \
$(top_builddir)/xsltproc/xsltproc: $(top_builddir)/xsltproc/xsltproc:
@(cd ../../xsltproc ; $(MAKE) 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 \ creation current dbonerow dbtail decoy depth encrypt functions game \
html identity inventory metric number oddtemplate patterns prettyprint \ html identity inventory metric number oddtemplate patterns prettyprint \
priority products queens reverser stringsort summarize total tower trend \ priority products queens reverser stringsort summarize total tower trend \

View File

@ -1,13 +1,15 @@
## Process this file with automake to produce Makefile.in ## 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: $(top_builddir)/xsltproc/xsltproc:
@(cd ../../xsltproc ; $(MAKE) xsltproc) @(cd ../../xsltproc ; $(MAKE) xsltproc)
EXTRA_DIST = README VERSION EXTRA_DIST = README VERSION
tests: htmltests xhtmltests fotests full: tests htmltests xhtmltests fotests
# #
# a single tests to check that stuff ain't broken # a single tests to check that stuff ain't broken

View File

@ -10,7 +10,7 @@ EXTRA_DIST = bredfort.css index.xml system.xml \
message.xml message.xsl message.result message.xml message.xsl message.result
all: test all:
test tests: $(top_builddir)/xsltproc/xsltproc test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)

View File

@ -4,4 +4,5 @@ SUBDIRS=common functions math sets strings
all: all:
test tests: all test tests:
@(cur=`pwd` ; for dir in $(SUBDIRS) ; do cd $$dir ; make tests ; cd $$cur ; done)

View File

@ -9,7 +9,7 @@ EXTRA_DIST = \
node-set.3.xml node-set.3.xsl node-set.3.out \ node-set.3.xml node-set.3.xsl node-set.3.out \
object-type.1.xml object-type.1.xsl object-type.1.out object-type.1.xml object-type.1.xsl object-type.1.out
all: test all:
test tests: $(top_builddir)/xsltproc/xsltproc test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)

View File

@ -11,7 +11,7 @@ EXTRA_DIST = \
function.5.out function.5.xml function.5.xsl \ function.5.out function.5.xml function.5.xsl \
function.6.out function.6.xml function.6.xsl function.6.out function.6.xml function.6.xsl
all: test all:
test tests: $(top_builddir)/xsltproc/xsltproc test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)

View File

@ -15,7 +15,7 @@ EXTRA_DIST = \
min.1.out min.1.xml min.1.xsl \ min.1.out min.1.xml min.1.xsl \
min.2.out min.2.xml min.2.xsl min.2.out min.2.xml min.2.xsl
all: test all:
test tests: $(top_builddir)/xsltproc/xsltproc test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)

View File

@ -10,7 +10,7 @@ EXTRA_DIST = \
leading.1.out leading.1.xml leading.1.xsl \ leading.1.out leading.1.xml leading.1.xsl \
trailing.1.out trailing.1.xml trailing.1.xsl trailing.1.out trailing.1.xml trailing.1.xsl
all: test all:
test tests: $(top_builddir)/xsltproc/xsltproc test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)

View File

@ -6,7 +6,7 @@ $(top_builddir)/xsltproc/xsltproc:
EXTRA_DIST = \ EXTRA_DIST = \
tokenize.1.xml tokenize.1.xsl tokenize.1.out tokenize.1.xml tokenize.1.xsl tokenize.1.out
all: test all:
test tests: $(top_builddir)/xsltproc/xsltproc test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)

View File

@ -8,7 +8,7 @@ EXTRA_DIST = \
list.xml list.xsl list.out list.xml list.xsl list.out
all: test all:
test tests: $(top_builddir)/xsltproc/xsltproc test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)

View File

@ -80,7 +80,7 @@ EXTRA_DIST = \
inner.xsl inner.xsl
all: test all:
test tests: $(top_builddir)/xsltproc/xsltproc test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)

View File

@ -28,7 +28,7 @@ GENERATED = \
out/letterw.html out/letterx.html out/lettery.html out/letterz.html \ out/letterw.html out/letterx.html out/lettery.html out/letterz.html \
out/titlepage.html out/titlepage.html
all: test all:
test tests: $(top_builddir)/xsltproc/xsltproc test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)

View File

@ -10,7 +10,7 @@ EXTRA_DIST = \
extra.out extra.xml extra.xsl \ extra.out extra.xml extra.xsl \
extra2.out extra2.xml extra2.xsl extra2.out extra2.xml extra2.xsl
all: test all:
test tests: $(top_builddir)/xsltproc/xsltproc test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)

View File

@ -5,7 +5,7 @@ $(top_builddir)/xsltproc/xsltproc:
EXTRA_DIST = format-number.xsl format-number.xml format-number.out EXTRA_DIST = format-number.xsl format-number.xml format-number.out
all: test all:
test tests: $(top_builddir)/xsltproc/xsltproc test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)

View File

@ -9,7 +9,7 @@ EXTRA_DIST = \
undefvar.xml undefvar.xsl undefvar.out undefvar.err undefvar.xml undefvar.xsl undefvar.out undefvar.err
all: test all:
test tests: $(top_builddir)/xsltproc/xsltproc test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)

View 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 \ logo-REC xmlspec.xsl REC-xml-2e.xsl diffspec.xsl \
REC-xml-20001006.html REC-xml-20001006-review.html REC-xml-20001006.html REC-xml-20001006-review.html
all: test all:
test tests: $(top_builddir)/xsltproc/xsltproc test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump) @(echo > .memdump)