blob: b8cbb4a6a3c0950d07c37260291a9ffcd2a2e5ee [file] [log] [blame]
Daniel Veillard01791d51998-07-24 19:24:09 +00001## Process this file with automake to produce Makefile.in
Daniel Veillard77044732001-06-29 21:31:07 +00002
Daniel Veillard3157e512010-03-09 11:32:46 +01003ACLOCAL_AMFLAGS = -I m4
4
Daniel Veillardb1da40c2004-09-06 11:57:44 +00005SUBDIRS = include . doc example xstc @PYTHON_SUBDIR@
Daniel Veillard19b858c1999-02-06 18:12:01 +00006
Daniel Veillardb1da40c2004-09-06 11:57:44 +00007DIST_SUBDIRS = include . doc example python xstc
Daniel Veillard72336152002-09-21 13:08:14 +00008
Daniel Veillard91ad8792002-11-04 17:06:52 +00009INCLUDES = -I$(top_builddir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@
Daniel Veillard14fff061999-06-22 21:49:07 +000010
Daniel Veillard6eadf632003-01-23 18:29:16 +000011noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \
Daniel Veillard877a7bd2003-09-13 00:16:32 +000012 testThreads testC14N testAutomata testRegexp \
Daniel Veillard7e5c3f42008-07-29 16:12:31 +000013 testReader testapi testModule runtest runsuite testchar \
Daniel Veillard0161e632008-08-28 15:36:32 +000014 testdict runxmlconf testrecurse
Daniel Veillard27fb0751998-10-17 06:47:46 +000015
Daniel Veillard344cee72001-08-20 00:08:40 +000016bin_PROGRAMS = xmllint xmlcatalog
Daniel Veillard01791d51998-07-24 19:24:09 +000017
Owen Taylor3473f882001-02-23 17:55:21 +000018bin_SCRIPTS=xml2-config
19
20lib_LTLIBRARIES = libxml2.la
Daniel Veillard6984e6d2003-12-09 14:20:17 +000021libxml2_la_LIBADD = @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) @M_LIBS@ @WIN32_EXTRA_LIBADD@
Owen Taylor3473f882001-02-23 17:55:21 +000022
Daniel Veillard8ed10722009-08-20 19:17:36 +020023if USE_VERSION_SCRIPT
24LIBXML2_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxml2.syms
25else
26LIBXML2_VERSION_SCRIPT =
27endif
28
29libxml2_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ \
30 $(LIBXML2_VERSION_SCRIPT) \
31 -version-info @LIBXML_VERSION_INFO@ \
32 @MODULE_PLATFORM_LIBS@
Owen Taylor3473f882001-02-23 17:55:21 +000033
Daniel Veillard7150a032001-05-02 16:41:11 +000034if WITH_TRIO_SOURCES
Daniel Veillard92ad2102001-03-27 12:47:33 +000035libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
36 parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \
37 valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \
Daniel Veillardeae522a2001-04-23 13:41:34 +000038 xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \
William M. Bracka2e844a2004-01-06 11:52:13 +000039 catalog.c globals.c threads.c c14n.c xmlstring.c \
Daniel Veillard49d5af82002-05-23 11:55:49 +000040 xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
Daniel Veillard4432df22003-09-28 18:58:27 +000041 triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c \
Daniel Veillarded6c5492005-07-23 15:00:22 +000042 xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \
43 xmlmodule.c schematron.c
Daniel Veillard7150a032001-05-02 16:41:11 +000044else
45libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
46 parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \
47 valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \
Daniel Veillarda7374592001-05-10 14:17:55 +000048 xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \
William M. Bracka2e844a2004-01-06 11:52:13 +000049 catalog.c globals.c threads.c c14n.c xmlstring.c \
Daniel Veillarde1ca5032002-12-09 14:13:43 +000050 xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
Daniel Veillard4432df22003-09-28 18:58:27 +000051 xmlreader.c relaxng.c dict.c SAX2.c \
Daniel Veillardce1648b2005-01-04 15:10:22 +000052 xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \
Daniel Veillarded6c5492005-07-23 15:00:22 +000053 xmlmodule.c schematron.c
Daniel Veillard7150a032001-05-02 16:41:11 +000054endif
Owen Taylor3473f882001-02-23 17:55:21 +000055
56DEPS = $(top_builddir)/libxml2.la
Daniel Veillard6984e6d2003-12-09 14:20:17 +000057LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) @M_LIBS@ @WIN32_EXTRA_LIBADD@
Daniel Veillard1638a472003-08-14 01:23:25 +000058
Owen Taylor3473f882001-02-23 17:55:21 +000059
Daniel Veillarde915b2d2002-03-06 18:42:40 +000060man_MANS = xml2-config.1 libxml.3
Owen Taylor3473f882001-02-23 17:55:21 +000061
62m4datadir = $(datadir)/aclocal
63m4data_DATA = libxml.m4
64
Daniel Veillard1b75c3b2005-06-26 21:49:08 +000065runtest_SOURCES=runtest.c
66runtest_LDFLAGS =
67runtest_DEPENDENCIES = $(DEPS)
Daniel Veillardf2e066a2005-06-30 13:04:44 +000068runtest_LDADD= @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS)
69
Daniel Veillard0161e632008-08-28 15:36:32 +000070testrecurse_SOURCES=testrecurse.c
71testrecurse_LDFLAGS =
72testrecurse_DEPENDENCIES = $(DEPS)
73testrecurse_LDADD= @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS)
74
Daniel Veillard34e3f642008-07-29 09:02:27 +000075testchar_SOURCES=testchar.c
76testchar_LDFLAGS =
77testchar_DEPENDENCIES = $(DEPS)
78testchar_LDADD= @RDL_LIBS@ $(LDADDS)
79
Daniel Veillardd330f182008-08-08 12:03:22 +000080testdict_SOURCES=testdict.c
81testdict_LDFLAGS =
82testdict_DEPENDENCIES = $(DEPS)
83testdict_LDADD= @RDL_LIBS@ $(LDADDS)
84
Daniel Veillardf2e066a2005-06-30 13:04:44 +000085runsuite_SOURCES=runsuite.c
86runsuite_LDFLAGS =
87runsuite_DEPENDENCIES = $(DEPS)
88runsuite_LDADD= @RDL_LIBS@ $(LDADDS)
Daniel Veillard1b75c3b2005-06-26 21:49:08 +000089
Owen Taylor3473f882001-02-23 17:55:21 +000090xmllint_SOURCES=xmllint.c
Daniel Veillard361d8452000-04-03 19:48:13 +000091xmllint_LDFLAGS =
92xmllint_DEPENDENCIES = $(DEPS)
Owen Taylor3473f882001-02-23 17:55:21 +000093xmllint_LDADD= @RDL_LIBS@ $(LDADDS)
Daniel Veillard01791d51998-07-24 19:24:09 +000094
Owen Taylor3473f882001-02-23 17:55:21 +000095testSAX_SOURCES=testSAX.c
Daniel Veillard011b63c1999-06-02 17:44:04 +000096testSAX_LDFLAGS =
97testSAX_DEPENDENCIES = $(DEPS)
Owen Taylor3473f882001-02-23 17:55:21 +000098testSAX_LDADD= $(LDADDS)
Daniel Veillard011b63c1999-06-02 17:44:04 +000099
Owen Taylor3473f882001-02-23 17:55:21 +0000100testHTML_SOURCES=testHTML.c
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000101testHTML_LDFLAGS =
102testHTML_DEPENDENCIES = $(DEPS)
Owen Taylor3473f882001-02-23 17:55:21 +0000103testHTML_LDADD= $(LDADDS)
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000104
Daniel Veillard344cee72001-08-20 00:08:40 +0000105xmlcatalog_SOURCES=xmlcatalog.c
106xmlcatalog_LDFLAGS =
107xmlcatalog_DEPENDENCIES = $(DEPS)
Daniel Veillard03f848d2001-11-07 12:53:46 +0000108xmlcatalog_LDADD= @RDL_LIBS@ $(LDADDS)
Daniel Veillarda7374592001-05-10 14:17:55 +0000109
Owen Taylor3473f882001-02-23 17:55:21 +0000110testXPath_SOURCES=testXPath.c
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000111testXPath_LDFLAGS =
112testXPath_DEPENDENCIES = $(DEPS)
Owen Taylor3473f882001-02-23 17:55:21 +0000113testXPath_LDADD= $(LDADDS)
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000114
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000115testC14N_SOURCES=testC14N.c
116testC14N_LDFLAGS =
117testC14N_DEPENDENCIES = $(DEPS)
118testC14N_LDADD= $(LDADDS)
119
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000120testThreads_SOURCES=testThreads@THREADS_W32@.c
Daniel Veillardab7488e2001-10-17 11:30:37 +0000121testThreads_LDFLAGS =
122testThreads_DEPENDENCIES = $(DEPS)
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000123testThreads_LDADD= @BASE_THREAD_LIBS@ $(LDADDS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000124
Owen Taylor3473f882001-02-23 17:55:21 +0000125testURI_SOURCES=testURI.c
Daniel Veillard361d8452000-04-03 19:48:13 +0000126testURI_LDFLAGS =
127testURI_DEPENDENCIES = $(DEPS)
Owen Taylor3473f882001-02-23 17:55:21 +0000128testURI_LDADD= $(LDADDS)
Daniel Veillard361d8452000-04-03 19:48:13 +0000129
Daniel Veillard4255d502002-04-16 15:50:10 +0000130testRegexp_SOURCES=testRegexp.c
131testRegexp_LDFLAGS =
132testRegexp_DEPENDENCIES = $(DEPS)
133testRegexp_LDADD= $(LDADDS)
134
135testAutomata_SOURCES=testAutomata.c
136testAutomata_LDFLAGS =
137testAutomata_DEPENDENCIES = $(DEPS)
138testAutomata_LDADD= $(LDADDS)
139
140testSchemas_SOURCES=testSchemas.c
141testSchemas_LDFLAGS =
142testSchemas_DEPENDENCIES = $(DEPS)
143testSchemas_LDADD= $(LDADDS)
144
Daniel Veillard6eadf632003-01-23 18:29:16 +0000145testRelax_SOURCES=testRelax.c
146testRelax_LDFLAGS =
147testRelax_DEPENDENCIES = $(DEPS)
148testRelax_LDADD= $(LDADDS)
149
Daniel Veillarde1ca5032002-12-09 14:13:43 +0000150testReader_SOURCES=testReader.c
151testReader_LDFLAGS =
152testReader_DEPENDENCIES = $(DEPS)
153testReader_LDADD= $(LDADDS)
154
Daniel Veillardce1648b2005-01-04 15:10:22 +0000155testModule_SOURCES=testModule.c
156testModule_LDFLAGS =
157testModule_DEPENDENCIES = $(DEPS)
158testModule_LDADD= $(LDADDS)
159
160noinst_LTLIBRARIES = testdso.la
161testdso_la_SOURCES = testdso.c
Roumen Petrov120a2692010-03-10 10:07:49 +0100162testdso_la_LDFLAGS = -module -no-undefined -avoid-version -rpath $(libdir)
Daniel Veillardce1648b2005-01-04 15:10:22 +0000163
Daniel Veillard2ae13382005-01-25 23:45:06 +0000164# that one forces the rebuild when "make rebuild" is run on doc/
165rebuild_testapi:
166 -@(if [ "$(PYTHON)" != "" ] ; then \
167 $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi )
168
169# that one is just to make sure it is rebuilt if missing
170# but adding the dependances generate mess
Daniel Veillardda3fee42008-09-01 13:08:57 +0000171testapi.c: $(srcdir)/gentest.py
William M. Brack106cad62004-12-23 15:56:12 +0000172 -@(if [ "$(PYTHON)" != "" ] ; then \
173 $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi )
Daniel Veillard36e5cd52004-11-02 14:52:23 +0000174
175testapi_SOURCES=testapi.c
176testapi_LDFLAGS =
177testapi_DEPENDENCIES = $(DEPS)
178testapi_LDADD= $(LDADDS)
179
Daniel Veillard7e5c3f42008-07-29 16:12:31 +0000180runxmlconf_SOURCES=runxmlconf.c
181runxmlconf_LDFLAGS =
182runxmlconf_DEPENDENCIES = $(DEPS)
183runxmlconf_LDADD= $(LDADDS)
184
Daniel Veillardde0a0a52003-04-24 17:12:57 +0000185#testOOM_SOURCES=testOOM.c testOOMlib.h testOOMlib.c
186#testOOM_LDFLAGS =
187#testOOM_DEPENDENCIES = $(DEPS)
188#testOOM_LDADD= $(LDADDS)
Daniel Veillarda76fe5c2003-04-24 16:06:47 +0000189
Daniel Veillard051d52c2008-07-29 16:44:59 +0000190runtests:
Daniel Veillard4cc67bb2008-08-29 19:58:23 +0000191 $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT)
Daniel Veillardda3fee42008-09-01 13:08:57 +0000192 @(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; \
193 $(MAKE) MAKEFLAGS+=--silent tests ; fi)
Daniel Veillard051d52c2008-07-29 16:44:59 +0000194
Daniel Veillard37334572008-07-31 08:20:02 +0000195check: all runtests
Raja R Harinatha86c23e1999-03-05 22:14:01 +0000196
Daniel Veillard0765ae82008-08-08 12:14:37 +0000197check-valgrind: all
198 @echo '## Running the regression tests under Valgrind'
199 @echo '## Go get a cup of coffee it is gonna take a while ...'
200 $(MAKE) CHECKER='valgrind -q' check
201
Daniel Veillardf09e7e32000-10-01 15:53:30 +0000202testall : tests SVGtests SAXtests
Daniel Veillard011b63c1999-06-02 17:44:04 +0000203
Daniel Veillardc740a172005-07-31 12:17:24 +0000204tests: XMLtests XMLenttests NStests IDtests Errtests APItests @READER_TEST@ @TEST_SAX@ @TEST_PUSH@ @TEST_HTML@ @TEST_PHTML@ @TEST_VALID@ URItests @TEST_PATTERN@ @TEST_XPATH@ @TEST_XPTR@ @TEST_XINCLUDE@ @TEST_C14N@ @TEST_DEBUG@ @TEST_CATALOG@ @TEST_REGEXPS@ @TEST_SCHEMAS@ @TEST_SCHEMATRON@ @TEST_THREADS@ Timingtests @TEST_VTIME@ @PYTHON_TESTS@ @TEST_MODULES@
William M. Bracke9449c52004-07-11 14:41:20 +0000205 @(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; \
206 $(MAKE) MAKEFLAGS+=--silent tests ; fi)
207 @(cd doc/examples ; $(MAKE) MAKEFLAGS+=--silent tests)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000208
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000209valgrind:
210 @echo '## Running the regression tests under Valgrind'
211 @echo '## Go get a cup of coffee it is gonna take a while ...'
Daniel Veillardcb4284e2007-04-25 13:55:20 +0000212 $(MAKE) CHECKER='valgrind -q' tests
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000213
Daniel Veillardd0cf7f62004-11-09 16:17:02 +0000214APItests: testapi$(EXEEXT)
215 @echo "## Running the API regression tests this may take a little while"
216 -@($(CHECKER) $(top_builddir)/testapi -q)
217
Daniel Veillard07be19b2002-02-08 14:20:35 +0000218HTMLtests : testHTML$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000219 @(echo > .memdump)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000220 @echo "## HTML regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000221 -@(for i in $(srcdir)/test/HTML/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000222 name=`basename $$i`; \
Daniel Veillard82150d81999-07-07 07:32:15 +0000223 if [ ! -d $$i ] ; then \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000224 if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
225 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000226 $(CHECKER) $(top_builddir)/testHTML $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \
Daniel Veillard82150d81999-07-07 07:32:15 +0000227 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000228 log=`$(CHECKER) $(top_builddir)/testHTML $$i > result.$$name 2> error.$$name ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000229 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000230 diff $(srcdir)/result/HTML/$$name result.$$name ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000231 diff -b $(srcdir)/result/HTML/$$name.err error.$$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000232 $(CHECKER) $(top_builddir)/testHTML result.$$name > result2.$$name 2>error.$$name ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000233 diff result.$$name result2.$$name` ; \
234 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000235 rm result.$$name result2.$$name error.$$name ; \
Daniel Veillard82150d81999-07-07 07:32:15 +0000236 fi ; fi ; done)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000237
238HTMLPushtests : testHTML$(EXEEXT)
Daniel Veillard87b95392000-08-12 21:12:04 +0000239 @echo "## Push HTML regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000240 -@(for i in $(srcdir)/test/HTML/* ; do \
Daniel Veillard87b95392000-08-12 21:12:04 +0000241 name=`basename $$i`; \
242 if [ ! -d $$i ] ; then \
243 if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
244 echo New test file $$name ; \
William M. Brackf20fbf72004-06-25 05:49:08 +0000245 $(CHECKER) $(top_builddir)/testHTML --push $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000246 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000247 log=`$(CHECKER) $(top_builddir)/testHTML --push $$i > result.$$name 2> error.$$name ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000248 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
249 diff $(srcdir)/result/HTML/$$name result.$$name ; \
250 cut -b 1-15 $(srcdir)/result/HTML/$$name.err > errorcut.$$name; \
251 cut -b 1-15 error.$$name > errorcut2.$$name; \
252 diff -b errorcut.$$name errorcut2.$$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000253 $(CHECKER) $(top_builddir)/testHTML --push result.$$name > result2.$$name 2>error.$$name ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000254 diff result.$$name result2.$$name` ; \
255 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000256 rm result.$$name result2.$$name error.$$name errorcut.$$name errorcut2.$$name ; \
257 fi ; fi ; done)
Daniel Veillard87b95392000-08-12 21:12:04 +0000258 @echo "## HTML SAX regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000259 -@(for i in $(srcdir)/test/HTML/* ; do \
Daniel Veillard87b95392000-08-12 21:12:04 +0000260 name=`basename $$i`; \
261 if [ ! -d $$i ] ; then \
262 if [ ! -f $(srcdir)/result/HTML/$$name.sax ] ; then \
263 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000264 $(CHECKER) $(top_builddir)/testHTML --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000265 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000266 log=`$(CHECKER) $(top_builddir)/testHTML --sax $$i > result.$$name.sax ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000267 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000268 diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \
269 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000270 rm result.$$name.sax ; \
271 fi ; fi ; done)
Daniel Veillard87b95392000-08-12 21:12:04 +0000272 @echo "## Push HTML SAX regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000273 -@(for i in $(srcdir)/test/HTML/* ; do \
Daniel Veillard87b95392000-08-12 21:12:04 +0000274 name=`basename $$i`; \
275 if [ ! -d $$i ] ; then \
276 if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
277 echo New test file $$name ; \
William M. Brackf20fbf72004-06-25 05:49:08 +0000278 $(CHECKER) $(top_builddir)/testHTML --push --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000279 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000280 log=`$(CHECKER) $(top_builddir)/testHTML --push --sax $$i 2>&1 > result.$$name.sax ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000281 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000282 diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \
283 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000284 rm result.$$name.sax ; \
285 fi ; fi ; done)
286
Daniel Veillard07be19b2002-02-08 14:20:35 +0000287XMLtests : xmllint$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000288 @(echo > .memdump)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000289 @echo "## XML regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000290 -@(for i in $(srcdir)/test/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000291 name=`basename $$i`; \
Daniel Veillard01791d51998-07-24 19:24:09 +0000292 if [ ! -d $$i ] ; then \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000293 if [ ! -f $(srcdir)/result/$$name ] ; then \
294 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000295 $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000296 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard01791d51998-07-24 19:24:09 +0000297 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000298 log=`$(CHECKER) $(top_builddir)/xmllint $$i 2>&1 > result.$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000299 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000300 diff $(srcdir)/result/$$name result.$$name ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000301 $(CHECKER) $(top_builddir)/xmllint result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000302 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000303 diff result.$$name result2.$$name` ;\
304 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000305 rm result.$$name result2.$$name ; \
Daniel Veillard01791d51998-07-24 19:24:09 +0000306 fi ; fi ; done)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000307 @echo "## XML regression tests on memory"
Daniel Veillard73b013f2003-09-30 12:36:01 +0000308 -@(for i in $(srcdir)/test/* ; do \
309 name=`basename $$i`; \
310 if [ ! -d $$i ] ; then \
311 if [ ! -f $(srcdir)/result/$$name ] ; then \
312 echo New test file $$name ; \
313 $(CHECKER) $(top_builddir)/xmllint --memory $$i > $(srcdir)/result/$$name ; \
314 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
315 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000316 log=`$(CHECKER) $(top_builddir)/xmllint --memory $$i 2>&1 > result.$$name ; \
Daniel Veillard73b013f2003-09-30 12:36:01 +0000317 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
318 diff $(srcdir)/result/$$name result.$$name ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000319 $(CHECKER) $(top_builddir)/xmllint --memory result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \
320 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`; \
321 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard73b013f2003-09-30 12:36:01 +0000322 diff result.$$name result2.$$name ; \
323 rm result.$$name result2.$$name ; \
324 fi ; fi ; done)
325
326XMLPushtests: xmllint$(EXEEXT)
Daniel Veillard3e5bb8e2001-06-27 16:34:34 +0000327 @(echo > .memdump)
Daniel Veillard3e5bb8e2001-06-27 16:34:34 +0000328 @echo "## XML push regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000329 -@(for i in $(srcdir)/test/* ; do \
Daniel Veillard3e5bb8e2001-06-27 16:34:34 +0000330 name=`basename $$i`; \
331 if [ ! -d $$i ] ; then \
332 if [ ! -f $(srcdir)/result/$$name ] ; then \
333 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000334 $(CHECKER) $(top_builddir)/xmllint --push $$i > $(srcdir)/result/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000335 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard3e5bb8e2001-06-27 16:34:34 +0000336 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000337 log=`$(CHECKER) $(top_builddir)/xmllint --push $$i 2>&1 > result.$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000338 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard3e5bb8e2001-06-27 16:34:34 +0000339 diff $(srcdir)/result/$$name result.$$name ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000340 $(CHECKER) $(top_builddir)/xmllint --push result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000341 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000342 diff result.$$name result2.$$name` ; \
343 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard3e5bb8e2001-06-27 16:34:34 +0000344 rm result.$$name result2.$$name ; \
345 fi ; fi ; done)
Daniel Veillard01791d51998-07-24 19:24:09 +0000346
Daniel Veillard3b7840c2003-09-11 23:42:01 +0000347NStests : xmllint$(EXEEXT)
348 @(echo > .memdump)
Daniel Veillard3b7840c2003-09-11 23:42:01 +0000349 @echo "## XML Namespaces regression tests"
Daniel Veillard3b7840c2003-09-11 23:42:01 +0000350 -@(for i in $(srcdir)/test/namespaces/* ; do \
351 name=`basename $$i`; \
352 if [ ! -d $$i ] ; then \
353 if [ ! -f $(srcdir)/result/namespaces/$$name ] ; then \
354 echo New test file $$name ; \
355 $(CHECKER) $(top_builddir)/xmllint $$i \
356 2> $(srcdir)/result/namespaces/$$name.err \
357 > $(srcdir)/result/namespaces/$$name ; \
358 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
359 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000360 log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \
Daniel Veillard3b7840c2003-09-11 23:42:01 +0000361 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
362 diff $(srcdir)/result/namespaces/$$name result.$$name ; \
Daniel Veillard03a53c32004-10-26 16:06:51 +0000363 diff $(srcdir)/result/namespaces/$$name.err error.$$name`; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000364 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard3b7840c2003-09-11 23:42:01 +0000365 rm result.$$name error.$$name ; \
366 fi ; fi ; done)
367
Daniel Veillard67f8b1c2004-04-09 21:51:49 +0000368IDtests : xmllint$(EXEEXT) testXPath$(EXEEXT)
369 @(echo > .memdump)
370 @echo "## xml:id regression tests"
371 -@(for i in $(srcdir)/test/xmlid/id_*.xml ; do \
372 name=`basename $$i`; \
373 if [ ! -d $$i ] ; then \
374 if [ ! -f $(srcdir)/result/xmlid/$$name ] ; then \
375 echo New test file $$name ; \
376 $(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" \
377 2> $(srcdir)/result/xmlid/$$name.err \
378 > $(srcdir)/result/xmlid/$$name ; \
379 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
380 else \
381 log=`$(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" 2> error.$$name > result.$$name ; \
382 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
383 diff $(srcdir)/result/xmlid/$$name result.$$name ; \
384 diff $(srcdir)/result/xmlid/$$name.err error.$$name` ; \
385 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
386 rm result.$$name error.$$name ; \
387 fi ; fi ; done)
388
Daniel Veillard522bc602004-02-21 11:53:09 +0000389Errtests : xmllint$(EXEEXT)
390 @(echo > .memdump)
391 @echo "## Error cases regression tests"
392 -@(for i in $(srcdir)/test/errors/*.xml ; do \
393 name=`basename $$i`; \
394 if [ ! -d $$i ] ; then \
395 if [ ! -f $(srcdir)/result/errors/$$name ] ; then \
396 echo New test file $$name ; \
397 $(CHECKER) $(top_builddir)/xmllint $$i \
398 2> $(srcdir)/result/errors/$$name.err \
399 > $(srcdir)/result/errors/$$name ; \
400 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
401 else \
402 log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \
403 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
404 diff $(srcdir)/result/errors/$$name result.$$name ; \
405 diff $(srcdir)/result/errors/$$name.err error.$$name` ; \
406 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
407 rm result.$$name error.$$name ; \
408 fi ; fi ; done)
409 @echo "## Error cases stream regression tests"
410 -@(for i in $(srcdir)/test/errors/*.xml ; do \
411 name=`basename $$i`; \
412 if [ ! -d $$i ] ; then \
413 if [ ! -f $(srcdir)/result/errors/$$name.str ] ; then \
414 echo New test file $$name ; \
Daniel Veillard4a14fb82004-06-14 19:58:20 +0000415 $(CHECKER) $(top_builddir)/xmllint --stream $$i \
Daniel Veillard522bc602004-02-21 11:53:09 +0000416 2> $(srcdir)/result/errors/$$name.str \
Daniel Veillardb8590d42005-01-21 15:10:23 +0000417 > /dev/null ; \
Daniel Veillard522bc602004-02-21 11:53:09 +0000418 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
419 else \
Daniel Veillardb8590d42005-01-21 15:10:23 +0000420 log=`$(CHECKER) $(top_builddir)/xmllint --stream $$i 2> error.$$name > /dev/null ; \
Daniel Veillard522bc602004-02-21 11:53:09 +0000421 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard522bc602004-02-21 11:53:09 +0000422 diff $(srcdir)/result/errors/$$name.str error.$$name` ; \
423 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb8590d42005-01-21 15:10:23 +0000424 rm error.$$name ; \
Daniel Veillard522bc602004-02-21 11:53:09 +0000425 fi ; fi ; done)
426
Daniel Veillard07be19b2002-02-08 14:20:35 +0000427Docbtests : xmllint$(EXEEXT)
Daniel Veillard89cad532001-10-22 09:46:13 +0000428
Daniel Veillard07be19b2002-02-08 14:20:35 +0000429XMLenttests : xmllint$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000430 @(echo > .memdump)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000431 @echo "## XML entity subst regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000432 -@(for i in $(srcdir)/test/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000433 name=`basename $$i`; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000434 if [ ! -d $$i ] ; then \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000435 if [ ! -f $(srcdir)/result/noent/$$name ] ; then \
436 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000437 $(CHECKER) $(top_builddir)/xmllint --noent $$i > $(srcdir)/result/noent/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000438 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000439 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000440 log=`$(CHECKER) $(top_builddir)/xmllint --noent $$i 2>&1 > result.$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000441 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000442 diff $(srcdir)/result/noent/$$name result.$$name ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000443 $(CHECKER) $(top_builddir)/xmllint --noent result.$$name 2>&1 > result2.$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000444 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000445 diff result.$$name result2.$$name` ; \
446 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000447 rm result.$$name result2.$$name ; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000448 fi ; fi ; done)
449
Daniel Veillard07be19b2002-02-08 14:20:35 +0000450URItests : testURI$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000451 @(echo > .memdump)
Daniel Veillard98a79162000-09-04 11:15:39 +0000452 @echo "## URI module regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000453 -@(for i in $(srcdir)/test/URI/*.data ; do \
Daniel Veillard98a79162000-09-04 11:15:39 +0000454 name=`basename $$i`; \
455 if [ ! -d $$i ] ; then \
456 if [ ! -f $(srcdir)/result/URI/$$name ] ; then \
457 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000458 $(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i > $(srcdir)/result/URI/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000459 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard98a79162000-09-04 11:15:39 +0000460 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000461 log=`$(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i 2>&1 > result.$$name ; \
Daniel Veillard98a79162000-09-04 11:15:39 +0000462 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000463 diff $(srcdir)/result/URI/$$name result.$$name` ; \
464 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard98a79162000-09-04 11:15:39 +0000465 rm result.$$name ; \
466 fi ; fi ; done)
Daniel Veillard36065812002-01-24 15:02:46 +0000467 -@(for i in $(srcdir)/test/URI/*.uri ; do \
Daniel Veillardb6e7fdb2001-02-02 17:07:32 +0000468 name=`basename $$i`; \
469 if [ ! -d $$i ] ; then \
470 if [ ! -f $(srcdir)/result/URI/$$name ] ; then \
471 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000472 $(CHECKER) $(top_builddir)/testURI < $$i > $(srcdir)/result/URI/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000473 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillardb6e7fdb2001-02-02 17:07:32 +0000474 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000475 log=`$(CHECKER) $(top_builddir)/testURI < $$i 2>&1 > result.$$name ; \
Daniel Veillardb6e7fdb2001-02-02 17:07:32 +0000476 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000477 diff $(srcdir)/result/URI/$$name result.$$name` ; \
478 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb6e7fdb2001-02-02 17:07:32 +0000479 rm result.$$name ; \
480 fi ; fi ; done)
Daniel Veillard98a79162000-09-04 11:15:39 +0000481
Daniel Veillard07be19b2002-02-08 14:20:35 +0000482XPathtests : testXPath$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000483 @(echo > .memdump)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000484 @echo "## XPath regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000485 -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \
Daniel Veillard017b1082001-06-21 11:20:21 +0000486 then echo Skipping debug not compiled in ; exit 0 ; fi ; \
487 for i in $(srcdir)/test/XPath/expr/* ; do \
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000488 name=`basename $$i`; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000489 if [ ! -d $$i ] ; then \
490 if [ ! -f $(srcdir)/result/XPath/expr/$$name ] ; then \
491 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000492 $(CHECKER) $(top_builddir)/testXPath -f --expr $$i > $(srcdir)/result/XPath/expr/$$name ; \
Daniel Veillard9e7160d2001-03-18 23:17:47 +0000493 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000494 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000495 log=`$(CHECKER) $(top_builddir)/testXPath -f --expr $$i 2>&1 > result.$$name ; \
Daniel Veillard9e7160d2001-03-18 23:17:47 +0000496 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000497 diff $(srcdir)/result/XPath/expr/$$name result.$$name` ; \
498 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000499 rm result.$$name ; \
Daniel Veillard017b1082001-06-21 11:20:21 +0000500 fi ; fi ; done ; \
501 for i in $(srcdir)/test/XPath/docs/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000502 if [ ! -d $$i ] ; then \
503 doc=`basename $$i`; \
504 for j in $(srcdir)/test/XPath/tests/$$doc* ; do \
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000505 if [ ! -f $$j ] ; then continue ; fi ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000506 name=`basename $$j`; \
507 if [ ! -d $$j ] ; then \
508 if [ ! -f $(srcdir)/result/XPath/tests/$$name ] ; then \
509 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000510 $(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j > $(srcdir)/result/XPath/tests/$$name ; \
Daniel Veillard9e7160d2001-03-18 23:17:47 +0000511 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000512 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000513 log=`$(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j 2>&1 > result.$$name ; \
Daniel Veillard9e7160d2001-03-18 23:17:47 +0000514 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000515 diff $(srcdir)/result/XPath/tests/$$name result.$$name` ; \
516 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000517 rm result.$$name ; \
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000518 fi ; fi ; done ; fi ; done)
519
Daniel Veillard07be19b2002-02-08 14:20:35 +0000520XPtrtests : testXPath$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000521 @(echo > .memdump)
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000522 @echo "## XPointer regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000523 -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \
Daniel Veillard017b1082001-06-21 11:20:21 +0000524 then echo Skipping debug not compiled in ; exit 0 ; fi ; \
525 for i in $(srcdir)/test/XPath/docs/* ; do \
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000526 if [ ! -d $$i ] ; then \
527 doc=`basename $$i`; \
528 for j in $(srcdir)/test/XPath/xptr/$$doc* ; do \
529 if [ ! -f $$j ] ; then continue ; fi ; \
530 name=`basename $$j`; \
531 if [ ! -d $$j ] ; then \
532 if [ ! -f $(srcdir)/result/XPath/xptr/$$name ] ; then \
533 echo New test file $$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000534 $(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j > $(srcdir)/result/XPath/xptr/$$name ; \
535 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000536 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000537 log=`$(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j 2>&1 > result.$$name ; \
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000538 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000539 diff $(srcdir)/result/XPath/xptr/$$name result.$$name` ; \
540 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000541 rm result.$$name ; \
542 fi ; fi ; done ; fi ; done)
543
Daniel Veillard07be19b2002-02-08 14:20:35 +0000544XIncludetests : xmllint$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000545 @(echo > .memdump)
Daniel Veillardbf432752000-11-12 15:56:56 +0000546 @echo "## XInclude regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000547 -@(for i in $(srcdir)/test/XInclude/docs/* ; do \
Daniel Veillardbf432752000-11-12 15:56:56 +0000548 name=`basename $$i`; \
549 if [ ! -d $$i ] ; then \
550 if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \
551 echo New test file $$name ; \
Daniel Veillarde74d2e12003-12-09 11:35:37 +0000552 $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000553 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardbf432752000-11-12 15:56:56 +0000554 else \
Daniel Veillard1f8658a2004-08-14 21:46:31 +0000555 log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > result.$$name 2>error.$$name ; \
Daniel Veillardbf432752000-11-12 15:56:56 +0000556 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillarde74d2e12003-12-09 11:35:37 +0000557 diff $(srcdir)/result/XInclude/$$name result.$$name ; \
558 diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000559 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillarde74d2e12003-12-09 11:35:37 +0000560 rm result.$$name error.$$name ; \
Daniel Veillardbf432752000-11-12 15:56:56 +0000561 fi ; fi ; done)
Daniel Veillardc14c3892004-08-16 12:34:50 +0000562 -@(for i in $(srcdir)/test/XInclude/docs/* ; do \
563 name=`basename $$i`; \
564 if [ ! -d $$i ] ; then \
565 if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \
566 echo New test file $$name ; \
567 $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \
568 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
569 else \
570 log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > result.$$name 2>error.$$name ; \
571 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
572 diff $(srcdir)/result/XInclude/$$name result.$$name ; \
573 diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \
574 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
575 rm result.$$name error.$$name ; \
576 fi ; fi ; done)
Daniel Veillard7899c5c2003-11-03 12:31:38 +0000577 @(echo > .memdump)
578 @echo "## XInclude xmlReader regression tests"
579 -@(for i in $(srcdir)/test/XInclude/docs/* ; do \
580 name=`basename $$i`; \
581 if [ ! -d $$i ] ; then \
582 if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \
583 echo New test file $$name ; \
William M. Brackf20fbf72004-06-25 05:49:08 +0000584 $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \
Daniel Veillard7899c5c2003-11-03 12:31:38 +0000585 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
586 else \
Daniel Veillard1f8658a2004-08-14 21:46:31 +0000587 log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \
Daniel Veillard7899c5c2003-11-03 12:31:38 +0000588 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillarde74d2e12003-12-09 11:35:37 +0000589 diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \
Daniel Veillard7899c5c2003-11-03 12:31:38 +0000590 diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \
591 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillarde74d2e12003-12-09 11:35:37 +0000592 rm result.$$name error.$$name ; \
Daniel Veillard7899c5c2003-11-03 12:31:38 +0000593 fi ; fi ; done)
Daniel Veillardc14c3892004-08-16 12:34:50 +0000594 -@(for i in $(srcdir)/test/XInclude/docs/* ; do \
595 name=`basename $$i`; \
596 if [ ! -d $$i ] ; then \
597 if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \
598 echo New test file $$name ; \
599 $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \
600 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
601 else \
602 log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \
603 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
604 diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \
605 diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \
606 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
607 rm result.$$name error.$$name ; \
608 fi ; fi ; done)
Daniel Veillardbf432752000-11-12 15:56:56 +0000609
Daniel Veillard07be19b2002-02-08 14:20:35 +0000610Scripttests : xmllint$(EXEEXT)
Daniel Veillardb8c9be92001-07-09 16:01:19 +0000611 @(echo > .memdump)
Daniel Veillardb8c9be92001-07-09 16:01:19 +0000612 @echo "## Scripts regression tests"
613 @echo "## Some of the base computations may be different if srcdir != ."
Daniel Veillard36065812002-01-24 15:02:46 +0000614 -@(for i in $(srcdir)/test/scripts/*.script ; do \
Daniel Veillardb8c9be92001-07-09 16:01:19 +0000615 name=`basename $$i .script`; \
616 xml=$(srcdir)/test/scripts/`basename $$i .script`.xml; \
617 if [ -f $$xml ] ; then \
618 if [ ! -f $(srcdir)/result/scripts/$$name ] ; then \
619 echo New test file $$name ; \
Daniel Veillard29b17482004-08-16 00:39:03 +0000620 $(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > $(srcdir)/result/scripts/$$name 2> $(srcdir)/result/scripts/$$name.err ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000621 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb8c9be92001-07-09 16:01:19 +0000622 else \
Daniel Veillard29b17482004-08-16 00:39:03 +0000623 log=`$(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > result.$$name 2> result.$$name.err ; \
Daniel Veillardb8c9be92001-07-09 16:01:19 +0000624 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard29b17482004-08-16 00:39:03 +0000625 diff $(srcdir)/result/scripts/$$name result.$$name ; \
626 diff $(srcdir)/result/scripts/$$name.err result.$$name.err` ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000627 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard29b17482004-08-16 00:39:03 +0000628 rm result.$$name result.$$name.err ; \
Daniel Veillardb8c9be92001-07-09 16:01:19 +0000629 fi ; fi ; done)
630
Daniel Veillard07be19b2002-02-08 14:20:35 +0000631Catatests : xmlcatalog$(EXEEXT)
Daniel Veillardcda96922001-08-21 10:56:31 +0000632 @(echo > .memdump)
Daniel Veillardcda96922001-08-21 10:56:31 +0000633 @echo "## Catalog regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000634 -@(for i in $(srcdir)/test/catalogs/*.script ; do \
Daniel Veillardcda96922001-08-21 10:56:31 +0000635 name=`basename $$i .script`; \
636 xml=$(srcdir)/test/catalogs/`basename $$i .script`.xml; \
637 if [ -f $$xml ] ; then \
638 if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
639 echo New test file $$name ; \
William M. Brackf20fbf72004-06-25 05:49:08 +0000640 $(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > $(srcdir)/result/catalogs/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000641 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardcda96922001-08-21 10:56:31 +0000642 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000643 log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > result.$$name ; \
Daniel Veillardcda96922001-08-21 10:56:31 +0000644 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000645 diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
646 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardcda96922001-08-21 10:56:31 +0000647 rm result.$$name ; \
648 fi ; fi ; done)
Daniel Veillard36065812002-01-24 15:02:46 +0000649 -@(for i in $(srcdir)/test/catalogs/*.script ; do \
Daniel Veillardc853b322001-11-06 15:24:37 +0000650 name=`basename $$i .script`; \
651 sgml=$(srcdir)/test/catalogs/`basename $$i .script`.sgml; \
652 if [ -f $$sgml ] ; then \
653 if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
654 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000655 $(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > $(srcdir)/result/catalogs/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000656 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardc853b322001-11-06 15:24:37 +0000657 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000658 log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000659 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000660 diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
661 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000662 rm result.$$name ; \
663 fi ; fi ; done)
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000664 @echo "## Add and del operations on XML Catalogs"
Daniel Veillard66651aa2002-11-15 11:21:43 +0000665 -@($(CHECKER) $(top_builddir)/xmlcatalog --create --noout $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000666 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000667 $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid sysid $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000668 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000669 $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid2 sysid2 $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000670 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000671 $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid3 sysid3 $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000672 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000673 diff result/catalogs/mycatalog.full $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000674 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000675 $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000676 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000677 $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid3 $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000678 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000679 $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid2 $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000680 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000681 diff result/catalogs/mycatalog.empty $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000682 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000683 rm -f $(srcdir)/result/catalogs/mycatalog)
Daniel Veillardcda96922001-08-21 10:56:31 +0000684
Daniel Veillard07be19b2002-02-08 14:20:35 +0000685SVGtests : xmllint$(EXEEXT)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000686 @echo "## SVG parsing regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000687 -@(for i in $(srcdir)/test/SVG/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000688 name=`basename $$i`; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000689 if [ ! -d $$i ] ; then \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000690 if [ ! -f $(srcdir)/result/SVG/$$name ] ; then \
691 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000692 $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/SVG/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000693 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard011b63c1999-06-02 17:44:04 +0000694 else \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000695 echo Testing $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000696 $(CHECKER) $(top_builddir)/xmllint $$i > result.$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000697 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000698 diff $(srcdir)/result/SVG/$$name result.$$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000699 $(CHECKER) $(top_builddir)/xmllint result.$$name > result2.$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000700 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000701 diff result.$$name result2.$$name ; \
702 rm result.$$name result2.$$name ; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000703 fi ; fi ; done)
704
Daniel Veillard07be19b2002-02-08 14:20:35 +0000705Threadtests : testThreads$(EXEEXT)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000706 @echo "## Threaded regression tests"
Daniel Veillardbb5abab2003-10-03 22:21:51 +0000707 -@($(CHECKER) $(top_builddir)/testThreads ; \
708 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
709 exit 0)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000710
Daniel Veillard81514ba2003-09-16 23:17:26 +0000711Readertests : xmllint$(EXEEXT)
Daniel Veillard8a44e592003-09-15 14:50:06 +0000712 @(echo > .memdump)
Daniel Veillard8a44e592003-09-15 14:50:06 +0000713 @echo "## Reader regression tests"
Daniel Veillard8a44e592003-09-15 14:50:06 +0000714 -@(for i in $(srcdir)/test/* ; do \
715 name=`basename $$i`; \
716 if [ ! -d $$i ] ; then \
717 if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \
718 echo New test file $$name ; \
719 $(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \
720 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
721 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000722 log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
Daniel Veillard8a44e592003-09-15 14:50:06 +0000723 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000724 diff $(srcdir)/result/$$name.rdr result.$$name` ; \
725 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard8a44e592003-09-15 14:50:06 +0000726 rm result.$$name ; \
727 fi ; fi ; done)
Daniel Veillard53350552003-09-18 13:35:51 +0000728 @echo "## Reader on memory regression tests"
Daniel Veillard53350552003-09-18 13:35:51 +0000729 -@(for i in $(srcdir)/test/* ; do \
730 name=`basename $$i`; \
731 if [ ! -d $$i ] ; then \
732 if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \
733 echo New test file $$name ; \
734 $(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \
735 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
736 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000737 log=`$(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
Daniel Veillard53350552003-09-18 13:35:51 +0000738 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000739 diff $(srcdir)/result/$$name.rdr result.$$name` ; \
740 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard53350552003-09-18 13:35:51 +0000741 rm result.$$name ; \
742 fi ; fi ; done)
Daniel Veillard7899c5c2003-11-03 12:31:38 +0000743 @(echo > .memdump)
744 @echo "## Walker regression tests"
745 -@(for i in $(srcdir)/test/* ; do \
746 name=`basename $$i`; \
747 if [ ! -d $$i ] ; then \
748 if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \
749 echo New test file $$name ; \
750 $(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \
751 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
752 else \
753 log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > result.$$name 2>/dev/null ; \
754 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
755 diff $(srcdir)/result/$$name.rdr result.$$name` ; \
756 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
757 rm result.$$name ; \
758 fi ; fi ; done)
Daniel Veillard0df3bc32004-06-08 12:03:41 +0000759 @echo "## Reader entities substitution regression tests"
760 -@(for i in $(srcdir)/test/* ; do \
761 name=`basename $$i`; \
762 if [ ! -d $$i ] ; then \
763 if [ ! -f $(srcdir)/result/$$name.rde ] ; then \
764 echo New test file $$name ; \
765 $(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > $(srcdir)/result/$$name.rde 2>/dev/null ; \
766 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
767 else \
768 log=`$(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
769 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
770 diff $(srcdir)/result/$$name.rde result.$$name` ; \
771 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
772 rm result.$$name ; \
773 fi ; fi ; done)
774
Daniel Veillard07be19b2002-02-08 14:20:35 +0000775SAXtests : testSAX$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000776 @(echo > .memdump)
Daniel Veillard4a5a9642005-06-27 10:40:55 +0000777 @echo "## SAX1 callbacks regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000778 -@(for i in $(srcdir)/test/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000779 name=`basename $$i`; \
780 if [ ! -d $$i ] ; then \
Daniel Veillard4b1577f2003-09-03 13:10:37 +0000781 if [ ! -f $(srcdir)/result/$$name.sax ] ; then \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000782 echo New test file $$name ; \
Daniel Veillardf403d292003-10-05 13:51:35 +0000783 $(CHECKER) $(top_builddir)/testSAX $$i > $(srcdir)/result/$$name.sax 2> /dev/null ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000784 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000785 else \
Daniel Veillardf403d292003-10-05 13:51:35 +0000786 log=`$(CHECKER) $(top_builddir)/testSAX $$i > result.$$name 2> /dev/null ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000787 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000788 diff $(srcdir)/result/$$name.sax result.$$name` ; \
789 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000790 rm result.$$name ; \
791 fi ; fi ; done)
Daniel Veillard4a5a9642005-06-27 10:40:55 +0000792 @echo "## SAX2 callbacks regression tests"
793 -@(for i in $(srcdir)/test/* ; do \
794 name=`basename $$i`; \
795 if [ ! -d $$i ] ; then \
796 if [ ! -f $(srcdir)/result/$$name.sax2 ] ; then \
797 echo New test file $$name ; \
798 $(CHECKER) $(top_builddir)/testSAX --sax2 $$i > $(srcdir)/result/$$name.sax2 2> /dev/null ; \
799 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
800 else \
801 log=`$(CHECKER) $(top_builddir)/testSAX --sax2 $$i > result.$$name 2> /dev/null ; \
802 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
803 diff $(srcdir)/result/$$name.sax2 result.$$name` ; \
804 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
805 rm result.$$name ; \
806 fi ; fi ; done)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +0000807
Daniel Veillard07be19b2002-02-08 14:20:35 +0000808Validtests : xmllint$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000809 @(echo > .memdump)
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000810 @echo "## Valid documents regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000811 -@(for i in $(srcdir)/test/VCM/* ; do \
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000812 name=`basename $$i`; \
813 if [ ! -d $$i ] ; then \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000814 log=`$(CHECKER) $(top_builddir)/xmllint --valid --noout --nowarning $$i ; \
815 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`;\
816 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000817 fi ; done ; exit 0)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000818 @echo "## Validity checking regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000819 -@(for i in $(srcdir)/test/VC/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000820 name=`basename $$i`; \
821 if [ ! -d $$i ] ; then \
822 if [ ! -f $(srcdir)/result/VC/$$name ] ; then \
823 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000824 $(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> $(srcdir)/result/VC/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000825 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000826 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000827 log=`$(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> result.$$name ; \
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000828 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000829 diff $(srcdir)/result/VC/$$name result.$$name` ; \
830 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000831 rm result.$$name ; \
832 fi ; fi ; done)
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000833 @echo "## General documents valid regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000834 -@(for i in $(srcdir)/test/valid/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000835 name=`basename $$i`; \
836 if [ ! -d $$i ] ; then \
837 if [ ! -f $(srcdir)/result/valid/$$name ] ; then \
838 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000839 $(CHECKER) $(top_builddir)/xmllint --valid $$i > $(srcdir)/result/valid/$$name 2>$(srcdir)/result/valid/$$name.err ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000840 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000841 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000842 log=`$(CHECKER) $(top_builddir)/xmllint --valid $$i > result.$$name 2>error.$$name ; \
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000843 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000844 diff $(srcdir)/result/valid/$$name result.$$name ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000845 diff $(srcdir)/result/valid/$$name.err error.$$name` ; \
846 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard35008381999-10-25 13:15:52 +0000847 rm result.$$name error.$$name ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000848 fi ; fi ; done)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +0000849
Daniel Veillard4255d502002-04-16 15:50:10 +0000850Regexptests: testRegexp$(EXEEXT)
851 @(echo > .memdump)
Daniel Veillard4255d502002-04-16 15:50:10 +0000852 @echo "## Regexp regression tests"
Daniel Veillard4255d502002-04-16 15:50:10 +0000853 -@(for i in $(srcdir)/test/regexp/* ; do \
854 name=`basename $$i`; \
855 if [ ! -d $$i ] ; then \
856 if [ ! -f $(srcdir)/result/regexp/$$name ] ; then \
857 echo New test file $$name ; \
858 $(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000859 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard4255d502002-04-16 15:50:10 +0000860 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000861 log=`$(CHECKER) $(top_builddir)/testRegexp -i $$i 2>&1 > result.$$name ; \
Daniel Veillard4255d502002-04-16 15:50:10 +0000862 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000863 diff $(srcdir)/result/regexp/$$name result.$$name` ; \
864 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard4255d502002-04-16 15:50:10 +0000865 rm result.$$name ; \
866 fi ; fi ; done)
Daniel Veillard355a0232005-08-22 12:58:05 +0000867 @echo "## Formal expresssions regression tests"
868 -@(for i in $(srcdir)/test/expr/* ; do \
869 name=`basename $$i`; \
870 if [ ! -d $$i ] ; then \
871 if [ ! -f $(srcdir)/result/expr/$$name ] ; then \
872 echo New test file $$name ; \
873 $(CHECKER) $(top_builddir)/testRegexp --expr -i $$i > $(srcdir)/result/expr/$$name; \
874 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
875 else \
876 log=`$(CHECKER) $(top_builddir)/testRegexp --expr -i $$i 2>&1 > result.$$name ; \
877 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
878 diff $(srcdir)/result/expr/$$name result.$$name` ; \
879 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
880 rm result.$$name ; \
881 fi ; fi ; done)
Daniel Veillard4255d502002-04-16 15:50:10 +0000882
883Automatatests: testAutomata$(EXEEXT)
884 @(echo > .memdump)
Daniel Veillard4255d502002-04-16 15:50:10 +0000885 @echo "## Automata regression tests"
Daniel Veillard4255d502002-04-16 15:50:10 +0000886 -@(for i in $(srcdir)/test/automata/* ; do \
887 name=`basename $$i`; \
888 if [ ! -d $$i ] ; then \
889 if [ ! -f $(srcdir)/result/automata/$$name ] ; then \
890 echo New test file $$name ; \
891 $(CHECKER) $(top_builddir)/testAutomata $$i > $(srcdir)/result/automata/$$name; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000892 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard4255d502002-04-16 15:50:10 +0000893 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000894 log=`$(CHECKER) $(top_builddir)/testAutomata $$i 2>&1 > result.$$name ; \
Daniel Veillard4255d502002-04-16 15:50:10 +0000895 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000896 diff $(srcdir)/result/automata/$$name result.$$name` ; \
897 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard4255d502002-04-16 15:50:10 +0000898 rm result.$$name ; \
899 fi ; fi ; done)
900
Daniel Veillard9ebb6322008-01-11 07:19:24 +0000901dba100000.xml: dbgenattr.pl
Daniel Veillardf6bc7c22003-09-17 22:33:22 +0000902 @echo "## generating dba100000.xml"
Daniel Veillard9ebb6322008-01-11 07:19:24 +0000903 @($(PERL) $(top_srcdir)/dbgenattr.pl 100000 > dba100000.xml)
Daniel Veillardf6bc7c22003-09-17 22:33:22 +0000904
Daniel Veillard9ebb6322008-01-11 07:19:24 +0000905Timingtests: xmllint$(EXEEXT) dba100000.xml
Daniel Veillardf6bc7c22003-09-17 22:33:22 +0000906 @echo "## Timing tests to try to detect performance"
907 @echo "## as well a memory usage breakage when streaming"
Daniel Veillarde96a2a42003-09-24 21:23:56 +0000908 @echo "## 1/ using the file interface"
909 @echo "## 2/ using the memory interface"
910 @echo "## 3/ repeated DOM parsing"
911 @echo "## 4/ repeated DOM validation"
Daniel Veillard9ebb6322008-01-11 07:19:24 +0000912 -@($(top_builddir)/xmllint --stream --timing dba100000.xml; \
Daniel Veillardd9e9c9d2003-09-18 22:03:46 +0000913 MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
914 if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
Daniel Veillardf6bc7c22003-09-17 22:33:22 +0000915 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
916 exit 0)
Daniel Veillard9ebb6322008-01-11 07:19:24 +0000917 -@($(top_builddir)/xmllint --stream --timing --memory dba100000.xml; \
Daniel Veillardd9e9c9d2003-09-18 22:03:46 +0000918 MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
919 if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
Daniel Veillardf6bc7c22003-09-17 22:33:22 +0000920 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
921 exit 0)
Daniel Veillardc74859e2004-02-26 09:57:32 +0000922 -@($(top_builddir)/xmllint --noout --timing --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
Daniel Veillarde96a2a42003-09-24 21:23:56 +0000923 MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
924 if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
925 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
926 exit 0)
Daniel Veillard4432df22003-09-28 18:58:27 +0000927
928VTimingtests: xmllint$(EXEEXT)
Daniel Veillardc74859e2004-02-26 09:57:32 +0000929 -@($(top_builddir)/xmllint --noout --timing --valid --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
Daniel Veillarde96a2a42003-09-24 21:23:56 +0000930 MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
931 if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
932 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
933 exit 0)
Daniel Veillardf6bc7c22003-09-17 22:33:22 +0000934
Aleksey Sanin508a1012002-05-31 06:32:32 +0000935C14Ntests : testC14N$(EXEEXT)
Aleksey Saninf8cb6dd2002-06-04 04:27:06 +0000936 @echo "## C14N and XPath regression tests"
Aleksey Sanin83868242009-07-09 10:26:22 +0200937 -@(for m in with-comments without-comments 1-1-without-comments exc-without-comments ; do \
Aleksey Sanin508a1012002-05-31 06:32:32 +0000938 for i in $(srcdir)/test/c14n/$$m/*.xml ; do \
939 if [ ! -d $$i ] ; then \
940 name=`basename $$i .xml`; \
Aleksey Saninf8cb6dd2002-06-04 04:27:06 +0000941 cmdline="$(CHECKER) $(top_builddir)/testC14N --$$m $$i"; \
Daniel Veillard63186732002-10-15 08:43:17 +0000942 if [ -f $(srcdir)/test/c14n/$$m/$$name.xpath ] ; then \
Aleksey Saninf8cb6dd2002-06-04 04:27:06 +0000943 cmdline="$$cmdline $(srcdir)/test/c14n/$$m/$$name.xpath"; \
Daniel Veillard63186732002-10-15 08:43:17 +0000944 if [ -f $(srcdir)/test/c14n/$$m/$$name.ns ] ; then \
Aleksey Saninf8cb6dd2002-06-04 04:27:06 +0000945 cmdline="$$cmdline '`cat $(srcdir)/test/c14n/$$m/$$name.ns`'"; \
946 fi; \
Aleksey Sanin508a1012002-05-31 06:32:32 +0000947 fi; \
Aleksey Saninf8cb6dd2002-06-04 04:27:06 +0000948 $$cmdline > $(srcdir)/test/c14n/test.tmp; \
Aleksey Sanin508a1012002-05-31 06:32:32 +0000949 if [ $$? -eq 0 ]; then \
Aleksey Saninc57f9c12002-05-31 19:14:57 +0000950 diff $(srcdir)/result/c14n/$$m/$$name $(srcdir)/test/c14n/test.tmp; \
Aleksey Sanin508a1012002-05-31 06:32:32 +0000951 if [ $$? -ne 0 ]; then \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000952 echo "Test $$m/$$name failed"; \
Aleksey Saninf8cb6dd2002-06-04 04:27:06 +0000953 cat $(srcdir)/test/c14n/test.tmp; \
Aleksey Sanin508a1012002-05-31 06:32:32 +0000954 fi; \
955 else \
956 echo "C14N failed"; \
957 fi; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000958 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Aleksey Sanin508a1012002-05-31 06:32:32 +0000959 fi; \
960 rm -f $(srcdir)/test/c14n/test.tmp; \
961 done; \
962 done)
Daniel Veillard4255d502002-04-16 15:50:10 +0000963
964Schemastests: testSchemas$(EXEEXT)
965 @(echo > .memdump)
Daniel Veillard4255d502002-04-16 15:50:10 +0000966 @echo "## Schemas regression tests"
Daniel Veillard8651f532002-04-17 09:06:27 +0000967 -@(for i in $(srcdir)/test/schemas/*_*.xsd ; do \
968 name=`basename $$i | sed 's+_.*++'`; \
969 sno=`basename $$i | sed 's+.*_\(.*\).xsd+\1+'`; \
970 for j in $(srcdir)/test/schemas/"$$name"_*.xml ; do \
Daniel Veillard5add8682003-03-10 13:13:58 +0000971 if [ -f $$j ] ; then \
Daniel Veillard8651f532002-04-17 09:06:27 +0000972 xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
973 if [ ! -f $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" ]; \
974 then \
Daniel Veillard6231e842002-04-18 11:54:04 +0000975 echo New test file "$$name"_"$$sno"_"$$xno" ; \
Daniel Veillard8651f532002-04-17 09:06:27 +0000976 $(CHECKER) $(top_builddir)/testSchemas $$i $$j \
977 > $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \
978 2> $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000979 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard8651f532002-04-17 09:06:27 +0000980 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000981 log=`$(CHECKER) $(top_builddir)/testSchemas $$i $$j \
Daniel Veillard8651f532002-04-17 09:06:27 +0000982 > res.$$name 2> err.$$name;\
983 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
984 diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \
985 res.$$name;\
986 diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err \
987 err.$$name;\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000988 grep Unimplemented err.$$name`; \
989 if [ -n "$$log" ] ; then echo "$$name"_"$$sno"_"$$xno" result ; echo $$log ; fi ; \
Daniel Veillard8651f532002-04-17 09:06:27 +0000990 rm res.$$name err.$$name ; \
Daniel Veillard5add8682003-03-10 13:13:58 +0000991 fi ; fi ;\
Daniel Veillard8651f532002-04-17 09:06:27 +0000992 done; done)
Daniel Veillard4255d502002-04-16 15:50:10 +0000993
Daniel Veillard71531f32003-02-05 13:19:53 +0000994Relaxtests: xmllint$(EXEEXT)
Daniel Veillard6eadf632003-01-23 18:29:16 +0000995 @(echo > .memdump)
Daniel Veillard6eadf632003-01-23 18:29:16 +0000996 @echo "## Relax-NG regression tests"
Daniel Veillard6eadf632003-01-23 18:29:16 +0000997 -@(for i in $(srcdir)/test/relaxng/*.rng ; do \
998 name=`basename $$i | sed 's+\.rng++'`; \
Daniel Veillard231d7912003-02-09 14:22:17 +0000999 if [ ! -f $(srcdir)/result/relaxng/"$$name"_valid ] ; then \
1000 echo New schemas $$name ; \
1001 $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \
1002 > $(srcdir)/result/relaxng/"$$name"_valid \
1003 2> $(srcdir)/result/relaxng/"$$name"_err; \
Daniel Veillard07cb8222003-09-10 10:51:05 +00001004 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard231d7912003-02-09 14:22:17 +00001005 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +00001006 log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \
Daniel Veillard231d7912003-02-09 14:22:17 +00001007 > res.$$name 2> err.$$name;\
1008 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
1009 diff $(srcdir)/result/relaxng/"$$name"_valid \
1010 res.$$name;\
1011 diff $(srcdir)/result/relaxng/"$$name"_err \
1012 err.$$name | grep -v "error detected at";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +00001013 grep Unimplemented err.$$name`; \
1014 if [ -n "$$log" ] ; then echo schemas $$name result ; echo $$log ; fi ; \
Daniel Veillard231d7912003-02-09 14:22:17 +00001015 rm res.$$name err.$$name ; \
1016 fi; \
Daniel Veillard6eadf632003-01-23 18:29:16 +00001017 for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \
1018 if [ -f $$j ] ; then \
1019 xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
1020 if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \
1021 then \
1022 echo New test file "$$name"_"$$xno" ; \
Daniel Veillard71531f32003-02-05 13:19:53 +00001023 $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \
Daniel Veillard6eadf632003-01-23 18:29:16 +00001024 > $(srcdir)/result/relaxng/"$$name"_"$$xno" \
1025 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \
Daniel Veillard07cb8222003-09-10 10:51:05 +00001026 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard6eadf632003-01-23 18:29:16 +00001027 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +00001028 log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \
Daniel Veillard6eadf632003-01-23 18:29:16 +00001029 > res.$$name 2> err.$$name;\
1030 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
1031 diff $(srcdir)/result/relaxng/"$$name"_"$$xno" \
1032 res.$$name;\
1033 diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \
Daniel Veillardd41f4f42003-01-29 21:07:52 +00001034 err.$$name | grep -v "error detected at";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +00001035 grep Unimplemented err.$$name`; \
1036 if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \
Daniel Veillard6eadf632003-01-23 18:29:16 +00001037 rm res.$$name err.$$name ; \
1038 fi ; fi ; \
1039 done; done)
Daniel Veillardf4e55762003-04-15 23:32:22 +00001040 @echo "## Relax-NG streaming regression tests"
Daniel Veillardf4e55762003-04-15 23:32:22 +00001041 -@(for i in $(srcdir)/test/relaxng/*.rng ; do \
1042 name=`basename $$i | sed 's+\.rng++'`; \
1043 for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \
1044 if [ -f $$j ] ; then \
1045 xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
1046 if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \
1047 then \
1048 echo New test file "$$name"_"$$xno" ; \
1049 $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \
1050 > $(srcdir)/result/relaxng/"$$name"_"$$xno" \
1051 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \
Daniel Veillard07cb8222003-09-10 10:51:05 +00001052 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardf4e55762003-04-15 23:32:22 +00001053 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +00001054 log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --stream --relaxng $$i $$j \
Daniel Veillardf4e55762003-04-15 23:32:22 +00001055 > res.$$name 2> err.$$name;\
1056 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardbb5abab2003-10-03 22:21:51 +00001057 diff $(srcdir)/result/relaxng/"$$name"_"$$xno" res.$$name;\
Daniel Veillardec18c962009-08-26 18:37:43 +02001058 if [ "$$name" != "tutor10_1" -a "$$name" != "tutor10_2" -a "$$name" != "tutor3_2" -a "$$name" != "307377" -a "$$name" != "tutor8_2" ] ; then \
Daniel Veillardbb5abab2003-10-03 22:21:51 +00001059 diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \
1060 err.$$name | grep -v "error detected at";\
1061 fi ; grep Unimplemented err.$$name`; \
William M. Bracka0c48ad2004-04-16 15:58:29 +00001062 if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \
Daniel Veillardf4e55762003-04-15 23:32:22 +00001063 rm res.$$name err.$$name ; \
1064 fi ; fi ; \
1065 done; done)
Daniel Veillard6eadf632003-01-23 18:29:16 +00001066
Daniel Veillardc740a172005-07-31 12:17:24 +00001067Schematrontests: xmllint$(EXEEXT)
1068 @(echo > .memdump)
1069 @echo "## Schematron regression tests"
1070 -@(for i in $(srcdir)/test/schematron/*.sct ; do \
1071 name=`basename $$i | sed 's+\.sct++'`; \
1072 for j in $(srcdir)/test/schematron/"$$name"_*.xml ; do \
1073 if [ -f $$j ] ; then \
1074 xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
1075 if [ ! -f $(srcdir)/result/schematron/"$$name"_"$$xno" ]; \
1076 then \
1077 echo New test file "$$name"_"$$xno" ; \
1078 $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
1079 > $(srcdir)/result/schematron/"$$name"_"$$xno" \
1080 2> $(srcdir)/result/schematron/"$$name"_"$$xno".err; \
1081 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
1082 else \
1083 log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
1084 > res.$$name 2> err.$$name;\
1085 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
1086 diff $(srcdir)/result/schematron/"$$name"_"$$xno" \
1087 res.$$name;\
1088 diff $(srcdir)/result/schematron/"$$name"_"$$xno".err \
1089 err.$$name | grep -v "error detected at";\
1090 grep Unimplemented err.$$name`; \
1091 if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \
1092 rm res.$$name err.$$name ; \
1093 fi ; fi ; \
1094 done; done)
1095
Daniel Veillard6dc91962004-03-22 19:10:02 +00001096RelaxNGPythonTests:
1097 @(if [ -x $(PYTHON) ] ; then \
Daniel Veillard6d38c752004-05-10 00:40:51 +00001098 PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH ; \
William M. Brackf5806742004-03-31 02:01:32 +00001099 export PYTHONPATH; \
William M. Bracka22da292005-02-12 01:08:22 +00001100 LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
1101 export LD_LIBRARY_PATH; \
Daniel Veillard6dc91962004-03-22 19:10:02 +00001102 echo "## Relax-NG Python based test suite 1" ; \
Daniel Veillard252004d2004-03-23 12:32:32 +00001103 $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite.py ; \
Daniel Veillard6dc91962004-03-22 19:10:02 +00001104 echo "## Relax-NG Python based test suite 2" ; \
Daniel Veillard252004d2004-03-23 12:32:32 +00001105 $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite2.py ; \
Daniel Veillard6dc91962004-03-22 19:10:02 +00001106 fi)
1107
1108SchemasPythonTests:
1109 @(if [ -x $(PYTHON) ] ; then \
Daniel Veillard6d38c752004-05-10 00:40:51 +00001110 PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH; \
William M. Brackf5806742004-03-31 02:01:32 +00001111 export PYTHONPATH; \
William M. Bracka22da292005-02-12 01:08:22 +00001112 LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
1113 export LD_LIBRARY_PATH; \
Daniel Veillard6dc91962004-03-22 19:10:02 +00001114 echo "## XML Schemas datatypes Python based test suite" ; \
Kasimier T. Buchcik27759f22005-12-05 15:32:28 +00001115 echo "## It is normal to see 11 errors reported" ; \
Daniel Veillard252004d2004-03-23 12:32:32 +00001116 $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \
Daniel Veillard6dc91962004-03-22 19:10:02 +00001117 fi)
Daniel Veillard522780e2004-09-24 12:14:55 +00001118 @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" MAKEFLAGS+=--silent pytests ; fi)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001119
Daniel Veillardf9d16912005-01-30 22:36:30 +00001120Patterntests: xmllint$(EXEEXT)
1121 @(echo > .memdump)
1122 @echo "## Pattern regression tests"
1123 -@(for i in $(srcdir)/test/pattern/*.pat ; do \
1124 name=`basename $$i .pat`; \
1125 if [ -f $(srcdir)/test/pattern/$$name.xml ] ; then \
1126 if [ ! -f $(srcdir)/result/pattern/$$name ] ; then \
1127 rm -f result.$$name ; \
1128 echo New test file $$name ; \
1129 for pat in `cat $$i` ; do \
Daniel Veillardd4301ab2005-02-03 22:24:10 +00001130 $(CHECKER) $(top_builddir)/xmllint --walker --pattern $$pat $(srcdir)/test/pattern/$$name.xml >> $(srcdir)/result/pattern/$$name ; \
Daniel Veillardf9d16912005-01-30 22:36:30 +00001131 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
1132 done ;\
1133 else \
1134 rm -f result.$$name ; \
1135 lst=`cat $$i` ; \
Daniel Veillardd4301ab2005-02-03 22:24:10 +00001136 log=`for pat in $$lst ; do $(CHECKER) $(top_builddir)/xmllint --walker --pattern $$pat $(srcdir)/test/pattern/$$name.xml 2>&1 >> result.$$name ; \
Daniel Veillardf9d16912005-01-30 22:36:30 +00001137 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
1138 done ;\
1139 diff $(srcdir)/result/pattern/$$name result.$$name` ; \
1140 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
1141 rm result.$$name ; \
1142 fi ; fi ; done ;)
1143
Daniel Veillardce1648b2005-01-04 15:10:22 +00001144ModuleTests: testModule$(EXEEXT) testdso.la
1145 @echo "## Module tests"
1146 @(./testModule$(EXEEXT))
1147
Daniel Veillard1a792412003-11-18 23:52:38 +00001148cleanup:
1149 -@(find . -name .\#\* -exec rm {} \;)
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001150 -@(find . -name \*.gcda -o *.gcno -exec rm {} \;)
Daniel Veillard33fe2882008-04-10 08:09:25 +00001151 -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm {} \;)
Daniel Veillard1a792412003-11-18 23:52:38 +00001152
1153dist-hook: cleanup libxml2.spec
Daniel Veillard580ced82003-03-21 21:22:48 +00001154 -cp libxml2.spec $(distdir)
Daniel Veillardb0641a12009-08-24 10:15:13 +02001155 (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn win32 macos vms VxWorks bakefile test result) | (cd $(distdir); tar xf -)
Michael Fulbright63dc42c1999-02-21 21:20:12 +00001156
Daniel Veillard0bff36d2004-08-31 09:37:03 +00001157dist-source: distdir
Daniel Veillarde4aaae22005-07-10 23:12:52 +00001158 $(AMTAR) -chof - --exclude Tests --exclude test --exclude result $(distdir) | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-sources+"`.tar.gz
Daniel Veillard0bff36d2004-08-31 09:37:03 +00001159
Daniel Veillard87b30462005-07-05 14:04:36 +00001160dist-test: distdir
Daniel Veillarde4aaae22005-07-10 23:12:52 +00001161 (mkdir -p $(distdir))
Daniel Veillardfde5b0b2007-02-12 17:31:53 +00001162 (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn xstc/Tests) | (cd $(distdir); tar xf -)
Daniel Veillard1f33c4d2005-07-10 21:38:31 +00001163 tar -cf - $(distdir)/test $(distdir)/result $(distdir)/xstc/Tests $(distdir)/Makefile.tests $(distdir)/README $(distdir)/README.tests $(distdir)/AUTHORS $(distdir)/testapi.c $(distdir)/runtest.c $(distdir)/runsuite.c | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-tests+"`.tar.gz
1164 @(rm -rf $(distdir)/xstc/Test)
Daniel Veillard87b30462005-07-05 14:04:36 +00001165
Daniel Veillard8e199902001-01-25 18:54:39 +00001166cleantar:
Daniel Veillard55253e22002-02-18 14:32:39 +00001167 @(rm -f libxml*.tar.gz COPYING.LIB)
Daniel Veillard8e199902001-01-25 18:54:39 +00001168
Daniel Veillard1a792412003-11-18 23:52:38 +00001169rpm: cleanup cleantar
Daniel Veillarde4aaae22005-07-10 23:12:52 +00001170 @(unset CDPATH ; $(MAKE) dist-source dist && rpmbuild -ta $(distdir).tar.gz)
Owen Taylor3473f882001-02-23 17:55:21 +00001171
1172## We create xml2Conf.sh here and not from configure because we want
1173## to get the paths expanded correctly. Macros like srcdir are given
1174## the value NONE in configure if the user doesn't specify them (this
1175## is an autoconf feature, not a bug).
1176
Daniel Veillard06d25242004-02-25 13:01:42 +00001177xml2Conf.sh: xml2Conf.sh.in Makefile
1178## Use sed and then mv to avoid problems if the user interrupts.
1179 sed -e 's?\@XML_LIBDIR\@?$(XML_LIBDIR)?g' \
1180 -e 's?\@XML_INCLUDEDIR\@?$(XML_INCLUDEDIR)?g' \
1181 -e 's?\@VERSION\@?$(VERSION)?g' \
1182 -e 's?\@XML_LIBS\@?$(XML_LIBS)?g' \
1183 < $(srcdir)/xml2Conf.sh.in > xml2Conf.tmp \
1184 && mv xml2Conf.tmp xml2Conf.sh
1185
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001186CLEANFILES=xml2Conf.sh *.gcda *.gcno
Owen Taylor3473f882001-02-23 17:55:21 +00001187
1188confexecdir=$(libdir)
1189confexec_DATA = xml2Conf.sh
Daniel Veillard7a5e0dd2004-09-17 08:45:25 +00001190CVS_EXTRA_DIST=
Daniel Veillard580ced82003-03-21 21:22:48 +00001191EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml2.spec \
Daniel Veillard96f6fe92004-11-04 10:52:50 +00001192 libxml.m4 Copyright check-xml-test-suite.py gentest.py \
Daniel Veillard252004d2004-03-23 12:32:32 +00001193 check-relaxng-test-suite.py check-relaxng-test-suite2.py \
1194 check-xsddata-test-suite.py check-xinclude-test-suite.py \
Owen Taylor3473f882001-02-23 17:55:21 +00001195 example/Makefile.am example/gjobread.c example/gjobs.xml \
AEST 2003 Malcolm Tredinnick06431122003-09-30 02:36:08 +00001196 $(man_MANS) libxml-2.0.pc.in libxml-2.0-uninstalled.pc.in \
Bjorn Reese026d29f2002-01-19 15:40:18 +00001197 trionan.c trionan.h triostr.c triostr.h trio.c trio.h \
Daniel Veillarda2351322004-06-27 12:08:10 +00001198 triop.h triodef.h libxml.h elfgcchack.h \
Daniel Veillardf6bc7c22003-09-17 22:33:22 +00001199 testThreadsWin32.c genUnicode.py TODO_SCHEMAS \
Daniel Veillarddab93ea2004-08-20 16:47:10 +00001200 dbgen.pl dbgenattr.pl regressions.py regressions.xml \
Daniel Veillard8ed10722009-08-20 19:17:36 +02001201 README.tests Makefile.tests libxml2.syms \
Daniel Veillarddab93ea2004-08-20 16:47:10 +00001202 $(CVS_EXTRA_DIST)
Daniel Veillardf6bc7c22003-09-17 22:33:22 +00001203
Owen Taylor3473f882001-02-23 17:55:21 +00001204
1205pkgconfigdir = $(libdir)/pkgconfig
1206pkgconfig_DATA = libxml-2.0.pc
1207
Daniel Veillard36065812002-01-24 15:02:46 +00001208#
William M. Brackf20fbf72004-06-25 05:49:08 +00001209# Install the tests program sources as examples
Daniel Veillard36065812002-01-24 15:02:46 +00001210#
Daniel Veillard366a9152002-10-23 20:43:53 +00001211BASE_DIR=$(datadir)/doc
Daniel Veillard36065812002-01-24 15:02:46 +00001212DOC_MODULE=libxml2-$(VERSION)
1213EXAMPLES_DIR=$(BASE_DIR)/$(DOC_MODULE)/examples
1214
1215install-data-local:
Adrian Bunk64b0d602010-11-04 09:43:31 +01001216 @MKDIR_P@ $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)
Daniel Veillardc575b992002-02-08 13:28:40 +00001217 -@INSTALL@ -m 0644 $(srcdir)/Copyright $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)
Adrian Bunk64b0d602010-11-04 09:43:31 +01001218 @MKDIR_P@ $(DESTDIR)$(EXAMPLES_DIR)
Daniel Veillard36065812002-01-24 15:02:46 +00001219 -@INSTALL@ -m 0644 $(srcdir)/xmllint.c $(DESTDIR)$(EXAMPLES_DIR)
1220 -@INSTALL@ -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR)
1221 -@INSTALL@ -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR)
1222 -@INSTALL@ -m 0644 $(srcdir)/testXPath.c $(DESTDIR)$(EXAMPLES_DIR)
Daniel Veillardda3b29a2004-08-14 11:15:13 +00001223
Daniel Veillard9ebb6322008-01-11 07:19:24 +00001224uninstall-local:
Daniel Veillard2173b5c2009-08-24 14:23:32 +02001225 rm -f $(DESTDIR)$(EXAMPLES_DIR)/testXPath.c
1226 rm -f $(DESTDIR)$(EXAMPLES_DIR)/testHTML.c
1227 rm -f $(DESTDIR)$(EXAMPLES_DIR)/testSAX.c
1228 rm -f $(DESTDIR)$(EXAMPLES_DIR)/xmllint.c
Daniel Veillard9ebb6322008-01-11 07:19:24 +00001229 rm -rf $(DESTDIR)$(EXAMPLES_DIR)
Daniel Veillard2173b5c2009-08-24 14:23:32 +02001230 rm -f $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)/Copyright
Daniel Veillard9ebb6322008-01-11 07:19:24 +00001231 rm -rf $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)
1232
Daniel Veillardda3b29a2004-08-14 11:15:13 +00001233tst: tst.c
1234 $(CC) $(CFLAGS) -Iinclude -o tst tst.c .libs/libxml2.a -lpthread -lm -lz
Daniel Veillard75e389d2005-07-29 22:02:24 +00001235
1236sparse: clean
1237 $(MAKE) CC=cgcc
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001238
1239#
1240# Coverage support, largely borrowed from libvirt
1241# Both binaries comes from the lcov package in Fedora
1242#
1243LCOV = /usr/bin/lcov
1244GENHTML = /usr/bin/genhtml
1245
1246cov: clean-cov
1247 if [ "`echo $(LDFLAGS) | grep coverage`" = "" ] ; then \
1248 echo not configured with coverage; exit 1 ; fi
1249 if [ ! -x $(LCOV) -o ! -x $(GENHTML) ] ; then \
1250 echo Need $(LCOV) and $(GENHTML) excecutables; exit 1 ; fi
1251 -@($(MAKE) check)
1252 -@(./runsuite$(EXEEXT))
1253 mkdir $(top_builddir)/coverage
1254 $(LCOV) -c -o $(top_builddir)/coverage/libxml2.info.tmp -d $(top_srcdir)
1255 $(LCOV) -r $(top_builddir)/coverage/libxml2.info.tmp -o $(top_builddir)/coverage/libxml2.info *usr*
1256 rm $(top_builddir)/coverage/libxml2.info.tmp
1257 $(GENHTML) -s -t "libxml2" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libxml2.info
1258 echo "Coverage report is in $(top_builddir)/coverage/index.html"
1259
1260clean-cov:
1261 rm -rf $(top_builddir)/coverage
1262