blob: 9f988b069bf59d77c0f4fc32482149954cc5a90b [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 Richard G5706b6d2012-08-06 11:32:54 +08005SUBDIRS = 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 Richard Gec4fc522012-08-17 10:04:30 +08009AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include
10
11AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS)
Daniel Veillard14fff061999-06-22 21:49:07 +000012
Daniel Veillard6eadf632003-01-23 18:29:16 +000013noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \
Daniel Veillard877a7bd2003-09-13 00:16:32 +000014 testThreads testC14N testAutomata testRegexp \
Daniel Veillard7e5c3f42008-07-29 16:12:31 +000015 testReader testapi testModule runtest runsuite testchar \
Daniel Veillard0de1f312012-07-18 17:43:34 +080016 testdict runxmlconf testrecurse testlimits
Daniel Veillard27fb0751998-10-17 06:47:46 +000017
Daniel Veillard344cee72001-08-20 00:08:40 +000018bin_PROGRAMS = xmllint xmlcatalog
Daniel Veillard01791d51998-07-24 19:24:09 +000019
Owen Taylor3473f882001-02-23 17:55:21 +000020bin_SCRIPTS=xml2-config
21
22lib_LTLIBRARIES = libxml2.la
Arfrever Frehtes Taifersar Arahesis1f01f492012-08-28 22:16:50 +080023libxml2_la_LIBADD = $(ICU_LIBS) $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD)
Owen Taylor3473f882001-02-23 17:55:21 +000024
Daniel Veillard8ed10722009-08-20 19:17:36 +020025if USE_VERSION_SCRIPT
26LIBXML2_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxml2.syms
27else
28LIBXML2_VERSION_SCRIPT =
29endif
30
Daniel Richard G5706b6d2012-08-06 11:32:54 +080031libxml2_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) \
32 $(LIBXML2_VERSION_SCRIPT) \
33 -version-info $(LIBXML_VERSION_INFO) \
34 $(MODULE_PLATFORM_LIBS)
Owen Taylor3473f882001-02-23 17:55:21 +000035
Akira TAGOH961b5352012-07-03 14:13:59 +090036if WITH_SAX1_SOURCES
37docb_sources = DOCBparser.c
Daniel Veillard7150a032001-05-02 16:41:11 +000038else
Akira TAGOH961b5352012-07-03 14:13:59 +090039docb_sources =
40endif
41
42if WITH_TRIO_SOURCES
43trio_sources = triostr.c trio.c
44else
45trio_sources =
46endif
47
Daniel Veillard7150a032001-05-02 16:41:11 +000048libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
49 parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \
50 valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \
Akira TAGOH961b5352012-07-03 14:13:59 +090051 xpointer.c xinclude.c nanohttp.c nanoftp.c \
52 $(docb_sources) \
Daniel Veillardbca22f42012-07-11 16:48:47 +080053 catalog.c globals.c threads.c c14n.c xmlstring.c buf.c \
Daniel Veillarde1ca5032002-12-09 14:13:43 +000054 xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
Akira TAGOH961b5352012-07-03 14:13:59 +090055 $(trio_sources) \
Daniel Veillard4432df22003-09-28 18:58:27 +000056 xmlreader.c relaxng.c dict.c SAX2.c \
Daniel Veillardce1648b2005-01-04 15:10:22 +000057 xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \
Daniel Veillardadf5ec92012-01-26 16:56:22 +080058 xmlmodule.c schematron.c xzlib.c
Owen Taylor3473f882001-02-23 17:55:21 +000059
60DEPS = $(top_builddir)/libxml2.la
Daniel Richard G5706b6d2012-08-06 11:32:54 +080061LDADDS = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD)
Daniel Veillard1638a472003-08-14 01:23:25 +000062
Owen Taylor3473f882001-02-23 17:55:21 +000063
Daniel Veillarde915b2d2002-03-06 18:42:40 +000064man_MANS = xml2-config.1 libxml.3
Owen Taylor3473f882001-02-23 17:55:21 +000065
66m4datadir = $(datadir)/aclocal
67m4data_DATA = libxml.m4
68
Daniel Veillard1b75c3b2005-06-26 21:49:08 +000069runtest_SOURCES=runtest.c
70runtest_LDFLAGS =
71runtest_DEPENDENCIES = $(DEPS)
Daniel Richard G5706b6d2012-08-06 11:32:54 +080072runtest_LDADD= $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS)
Daniel Veillardf2e066a2005-06-30 13:04:44 +000073
Daniel Veillard0161e632008-08-28 15:36:32 +000074testrecurse_SOURCES=testrecurse.c
75testrecurse_LDFLAGS =
76testrecurse_DEPENDENCIES = $(DEPS)
Daniel Richard G5706b6d2012-08-06 11:32:54 +080077testrecurse_LDADD= $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS)
Daniel Veillard0161e632008-08-28 15:36:32 +000078
Daniel Veillard0de1f312012-07-18 17:43:34 +080079testlimits_SOURCES=testlimits.c
80testlimits_LDFLAGS =
81testlimits_DEPENDENCIES = $(DEPS)
Daniel Richard G5706b6d2012-08-06 11:32:54 +080082testlimits_LDADD= $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS)
Daniel Veillard0de1f312012-07-18 17:43:34 +080083
Daniel Veillard34e3f642008-07-29 09:02:27 +000084testchar_SOURCES=testchar.c
85testchar_LDFLAGS =
86testchar_DEPENDENCIES = $(DEPS)
Daniel Richard G5706b6d2012-08-06 11:32:54 +080087testchar_LDADD= $(RDL_LIBS) $(LDADDS)
Daniel Veillard34e3f642008-07-29 09:02:27 +000088
Daniel Veillardd330f182008-08-08 12:03:22 +000089testdict_SOURCES=testdict.c
90testdict_LDFLAGS =
91testdict_DEPENDENCIES = $(DEPS)
Daniel Richard G5706b6d2012-08-06 11:32:54 +080092testdict_LDADD= $(RDL_LIBS) $(LDADDS)
Daniel Veillardd330f182008-08-08 12:03:22 +000093
Daniel Veillardf2e066a2005-06-30 13:04:44 +000094runsuite_SOURCES=runsuite.c
95runsuite_LDFLAGS =
96runsuite_DEPENDENCIES = $(DEPS)
Daniel Richard G5706b6d2012-08-06 11:32:54 +080097runsuite_LDADD= $(RDL_LIBS) $(LDADDS)
Daniel Veillard1b75c3b2005-06-26 21:49:08 +000098
Owen Taylor3473f882001-02-23 17:55:21 +000099xmllint_SOURCES=xmllint.c
Daniel Veillard361d8452000-04-03 19:48:13 +0000100xmllint_LDFLAGS =
101xmllint_DEPENDENCIES = $(DEPS)
Daniel Richard G5706b6d2012-08-06 11:32:54 +0800102xmllint_LDADD= $(RDL_LIBS) $(LDADDS)
Daniel Veillard01791d51998-07-24 19:24:09 +0000103
Owen Taylor3473f882001-02-23 17:55:21 +0000104testSAX_SOURCES=testSAX.c
Daniel Veillard011b63c1999-06-02 17:44:04 +0000105testSAX_LDFLAGS =
106testSAX_DEPENDENCIES = $(DEPS)
Owen Taylor3473f882001-02-23 17:55:21 +0000107testSAX_LDADD= $(LDADDS)
Daniel Veillard011b63c1999-06-02 17:44:04 +0000108
Owen Taylor3473f882001-02-23 17:55:21 +0000109testHTML_SOURCES=testHTML.c
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000110testHTML_LDFLAGS =
111testHTML_DEPENDENCIES = $(DEPS)
Owen Taylor3473f882001-02-23 17:55:21 +0000112testHTML_LDADD= $(LDADDS)
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000113
Daniel Veillard344cee72001-08-20 00:08:40 +0000114xmlcatalog_SOURCES=xmlcatalog.c
115xmlcatalog_LDFLAGS =
116xmlcatalog_DEPENDENCIES = $(DEPS)
Daniel Richard G5706b6d2012-08-06 11:32:54 +0800117xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS)
Daniel Veillarda7374592001-05-10 14:17:55 +0000118
Owen Taylor3473f882001-02-23 17:55:21 +0000119testXPath_SOURCES=testXPath.c
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000120testXPath_LDFLAGS =
121testXPath_DEPENDENCIES = $(DEPS)
Owen Taylor3473f882001-02-23 17:55:21 +0000122testXPath_LDADD= $(LDADDS)
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000123
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000124testC14N_SOURCES=testC14N.c
125testC14N_LDFLAGS =
126testC14N_DEPENDENCIES = $(DEPS)
127testC14N_LDADD= $(LDADDS)
128
Daniel Richard G5706b6d2012-08-06 11:32:54 +0800129if THREADS_W32
130testThreads_SOURCES = testThreadsWin32.c
131else
132testThreads_SOURCES = testThreads.c
133endif
Daniel Veillardab7488e2001-10-17 11:30:37 +0000134testThreads_LDFLAGS =
135testThreads_DEPENDENCIES = $(DEPS)
Daniel Richard G5706b6d2012-08-06 11:32:54 +0800136testThreads_LDADD= $(BASE_THREAD_LIBS) $(LDADDS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000137
Owen Taylor3473f882001-02-23 17:55:21 +0000138testURI_SOURCES=testURI.c
Daniel Veillard361d8452000-04-03 19:48:13 +0000139testURI_LDFLAGS =
140testURI_DEPENDENCIES = $(DEPS)
Owen Taylor3473f882001-02-23 17:55:21 +0000141testURI_LDADD= $(LDADDS)
Daniel Veillard361d8452000-04-03 19:48:13 +0000142
Daniel Veillard4255d502002-04-16 15:50:10 +0000143testRegexp_SOURCES=testRegexp.c
144testRegexp_LDFLAGS =
145testRegexp_DEPENDENCIES = $(DEPS)
146testRegexp_LDADD= $(LDADDS)
147
148testAutomata_SOURCES=testAutomata.c
149testAutomata_LDFLAGS =
150testAutomata_DEPENDENCIES = $(DEPS)
151testAutomata_LDADD= $(LDADDS)
152
153testSchemas_SOURCES=testSchemas.c
154testSchemas_LDFLAGS =
155testSchemas_DEPENDENCIES = $(DEPS)
156testSchemas_LDADD= $(LDADDS)
157
Daniel Veillard6eadf632003-01-23 18:29:16 +0000158testRelax_SOURCES=testRelax.c
159testRelax_LDFLAGS =
160testRelax_DEPENDENCIES = $(DEPS)
161testRelax_LDADD= $(LDADDS)
162
Daniel Veillarde1ca5032002-12-09 14:13:43 +0000163testReader_SOURCES=testReader.c
164testReader_LDFLAGS =
165testReader_DEPENDENCIES = $(DEPS)
166testReader_LDADD= $(LDADDS)
167
Daniel Veillardce1648b2005-01-04 15:10:22 +0000168testModule_SOURCES=testModule.c
169testModule_LDFLAGS =
170testModule_DEPENDENCIES = $(DEPS)
171testModule_LDADD= $(LDADDS)
172
173noinst_LTLIBRARIES = testdso.la
174testdso_la_SOURCES = testdso.c
Roumen Petrov120a2692010-03-10 10:07:49 +0100175testdso_la_LDFLAGS = -module -no-undefined -avoid-version -rpath $(libdir)
Daniel Veillardce1648b2005-01-04 15:10:22 +0000176
Daniel Veillard2ae13382005-01-25 23:45:06 +0000177# that one forces the rebuild when "make rebuild" is run on doc/
178rebuild_testapi:
179 -@(if [ "$(PYTHON)" != "" ] ; then \
180 $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi )
181
182# that one is just to make sure it is rebuilt if missing
183# but adding the dependances generate mess
Daniel Veillardda3fee42008-09-01 13:08:57 +0000184testapi.c: $(srcdir)/gentest.py
William M. Brack106cad62004-12-23 15:56:12 +0000185 -@(if [ "$(PYTHON)" != "" ] ; then \
186 $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi )
Daniel Veillard36e5cd52004-11-02 14:52:23 +0000187
Daniel Richard G5706b6d2012-08-06 11:32:54 +0800188BUILT_SOURCES = testapi.c
189
Daniel Veillard36e5cd52004-11-02 14:52:23 +0000190testapi_SOURCES=testapi.c
191testapi_LDFLAGS =
192testapi_DEPENDENCIES = $(DEPS)
193testapi_LDADD= $(LDADDS)
194
Daniel Veillard7e5c3f42008-07-29 16:12:31 +0000195runxmlconf_SOURCES=runxmlconf.c
196runxmlconf_LDFLAGS =
197runxmlconf_DEPENDENCIES = $(DEPS)
198runxmlconf_LDADD= $(LDADDS)
199
Daniel Veillardde0a0a52003-04-24 17:12:57 +0000200#testOOM_SOURCES=testOOM.c testOOMlib.h testOOMlib.c
201#testOOM_LDFLAGS =
202#testOOM_DEPENDENCIES = $(DEPS)
203#testOOM_LDADD= $(LDADDS)
Daniel Veillarda76fe5c2003-04-24 16:06:47 +0000204
Daniel Veillard051d52c2008-07-29 16:44:59 +0000205runtests:
Daniel Richard G5706b6d2012-08-06 11:32:54 +0800206 [ -d test ] || $(LN_S) $(srcdir)/test .
207 [ -d result ] || $(LN_S) $(srcdir)/result .
Daniel Veillard4cc67bb2008-08-29 19:58:23 +0000208 $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT)
Daniel Richard G5706b6d2012-08-06 11:32:54 +0800209 @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \
210 $(MAKE) tests ; fi)
Daniel Veillard051d52c2008-07-29 16:44:59 +0000211
Daniel Veillard37334572008-07-31 08:20:02 +0000212check: all runtests
Raja R Harinatha86c23e1999-03-05 22:14:01 +0000213
Daniel Veillard73f94c62012-08-24 16:38:54 +0800214check-valgrind valgrind: all
Daniel Veillard0765ae82008-08-08 12:14:37 +0000215 @echo '## Running the regression tests under Valgrind'
216 @echo '## Go get a cup of coffee it is gonna take a while ...'
Daniel Veillard73f94c62012-08-24 16:38:54 +0800217 $(MAKE) CHECKER='valgrind -q' runtests
Daniel Veillard0765ae82008-08-08 12:14:37 +0000218
Daniel Veillard9b4b8cb2016-05-04 12:33:32 +0800219asan:
220 @echo '## rebuilding for ASAN'
221 ./configure CFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" CXXFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" LDFLAGS="-fsanitize=address,undefined" CC="clang" CXX="clang++" --disable-shared ; OptimOff ; $(MAKE) clean ; $(MAKE)
222
Daniel Veillardf09e7e32000-10-01 15:53:30 +0000223testall : tests SVGtests SAXtests
Daniel Veillard011b63c1999-06-02 17:44:04 +0000224
Daniel Richard G5706b6d2012-08-06 11:32:54 +0800225tests: 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)
226 @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \
227 $(MAKE) tests ; fi)
228 @(cd doc/examples ; $(MAKE) tests)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000229
Daniel Veillardd0cf7f62004-11-09 16:17:02 +0000230APItests: testapi$(EXEEXT)
231 @echo "## Running the API regression tests this may take a little while"
232 -@($(CHECKER) $(top_builddir)/testapi -q)
233
Daniel Veillard07be19b2002-02-08 14:20:35 +0000234HTMLtests : testHTML$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000235 @(echo > .memdump)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000236 @echo "## HTML regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000237 -@(for i in $(srcdir)/test/HTML/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000238 name=`basename $$i`; \
Daniel Veillard82150d81999-07-07 07:32:15 +0000239 if [ ! -d $$i ] ; then \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000240 if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
241 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000242 $(CHECKER) $(top_builddir)/testHTML $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \
Daniel Veillard82150d81999-07-07 07:32:15 +0000243 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000244 log=`$(CHECKER) $(top_builddir)/testHTML $$i > result.$$name 2> error.$$name ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000245 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000246 diff $(srcdir)/result/HTML/$$name result.$$name ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000247 diff -b $(srcdir)/result/HTML/$$name.err error.$$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000248 $(CHECKER) $(top_builddir)/testHTML result.$$name > result2.$$name 2>error.$$name ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000249 diff result.$$name result2.$$name` ; \
250 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000251 rm result.$$name result2.$$name error.$$name ; \
Daniel Veillard82150d81999-07-07 07:32:15 +0000252 fi ; fi ; done)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000253
254HTMLPushtests : testHTML$(EXEEXT)
Daniel Veillard87b95392000-08-12 21:12:04 +0000255 @echo "## Push HTML regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000256 -@(for i in $(srcdir)/test/HTML/* ; do \
Daniel Veillard87b95392000-08-12 21:12:04 +0000257 name=`basename $$i`; \
258 if [ ! -d $$i ] ; then \
259 if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
260 echo New test file $$name ; \
William M. Brackf20fbf72004-06-25 05:49:08 +0000261 $(CHECKER) $(top_builddir)/testHTML --push $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000262 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000263 log=`$(CHECKER) $(top_builddir)/testHTML --push $$i > result.$$name 2> error.$$name ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000264 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
265 diff $(srcdir)/result/HTML/$$name result.$$name ; \
266 cut -b 1-15 $(srcdir)/result/HTML/$$name.err > errorcut.$$name; \
267 cut -b 1-15 error.$$name > errorcut2.$$name; \
268 diff -b errorcut.$$name errorcut2.$$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000269 $(CHECKER) $(top_builddir)/testHTML --push result.$$name > result2.$$name 2>error.$$name ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000270 diff result.$$name result2.$$name` ; \
271 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000272 rm result.$$name result2.$$name error.$$name errorcut.$$name errorcut2.$$name ; \
273 fi ; fi ; done)
Daniel Veillard87b95392000-08-12 21:12:04 +0000274 @echo "## HTML SAX regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000275 -@(for i in $(srcdir)/test/HTML/* ; do \
Daniel Veillard87b95392000-08-12 21:12:04 +0000276 name=`basename $$i`; \
277 if [ ! -d $$i ] ; then \
278 if [ ! -f $(srcdir)/result/HTML/$$name.sax ] ; then \
279 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000280 $(CHECKER) $(top_builddir)/testHTML --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000281 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000282 log=`$(CHECKER) $(top_builddir)/testHTML --sax $$i > result.$$name.sax ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000283 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000284 diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \
285 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000286 rm result.$$name.sax ; \
287 fi ; fi ; done)
Daniel Veillard87b95392000-08-12 21:12:04 +0000288 @echo "## Push HTML SAX regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000289 -@(for i in $(srcdir)/test/HTML/* ; do \
Daniel Veillard87b95392000-08-12 21:12:04 +0000290 name=`basename $$i`; \
291 if [ ! -d $$i ] ; then \
292 if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
293 echo New test file $$name ; \
William M. Brackf20fbf72004-06-25 05:49:08 +0000294 $(CHECKER) $(top_builddir)/testHTML --push --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000295 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000296 log=`$(CHECKER) $(top_builddir)/testHTML --push --sax $$i 2>&1 > result.$$name.sax ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000297 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000298 diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \
299 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000300 rm result.$$name.sax ; \
301 fi ; fi ; done)
302
Daniel Veillard07be19b2002-02-08 14:20:35 +0000303XMLtests : xmllint$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000304 @(echo > .memdump)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000305 @echo "## XML regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000306 -@(for i in $(srcdir)/test/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000307 name=`basename $$i`; \
Daniel Veillard01791d51998-07-24 19:24:09 +0000308 if [ ! -d $$i ] ; then \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000309 if [ ! -f $(srcdir)/result/$$name ] ; then \
310 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000311 $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000312 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard01791d51998-07-24 19:24:09 +0000313 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000314 log=`$(CHECKER) $(top_builddir)/xmllint $$i 2>&1 > result.$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000315 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000316 diff $(srcdir)/result/$$name result.$$name ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000317 $(CHECKER) $(top_builddir)/xmllint result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000318 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000319 diff result.$$name result2.$$name` ;\
320 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000321 rm result.$$name result2.$$name ; \
Daniel Veillard01791d51998-07-24 19:24:09 +0000322 fi ; fi ; done)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000323 @echo "## XML regression tests on memory"
Daniel Veillard73b013f2003-09-30 12:36:01 +0000324 -@(for i in $(srcdir)/test/* ; do \
325 name=`basename $$i`; \
326 if [ ! -d $$i ] ; then \
327 if [ ! -f $(srcdir)/result/$$name ] ; then \
328 echo New test file $$name ; \
329 $(CHECKER) $(top_builddir)/xmllint --memory $$i > $(srcdir)/result/$$name ; \
330 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
331 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000332 log=`$(CHECKER) $(top_builddir)/xmllint --memory $$i 2>&1 > result.$$name ; \
Daniel Veillard73b013f2003-09-30 12:36:01 +0000333 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
334 diff $(srcdir)/result/$$name result.$$name ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000335 $(CHECKER) $(top_builddir)/xmllint --memory result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \
336 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`; \
337 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard73b013f2003-09-30 12:36:01 +0000338 diff result.$$name result2.$$name ; \
339 rm result.$$name result2.$$name ; \
340 fi ; fi ; done)
341
342XMLPushtests: xmllint$(EXEEXT)
Daniel Veillard3e5bb8e2001-06-27 16:34:34 +0000343 @(echo > .memdump)
Daniel Veillard3e5bb8e2001-06-27 16:34:34 +0000344 @echo "## XML push regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000345 -@(for i in $(srcdir)/test/* ; do \
Daniel Veillard3e5bb8e2001-06-27 16:34:34 +0000346 name=`basename $$i`; \
347 if [ ! -d $$i ] ; then \
348 if [ ! -f $(srcdir)/result/$$name ] ; then \
349 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000350 $(CHECKER) $(top_builddir)/xmllint --push $$i > $(srcdir)/result/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000351 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard3e5bb8e2001-06-27 16:34:34 +0000352 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000353 log=`$(CHECKER) $(top_builddir)/xmllint --push $$i 2>&1 > result.$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000354 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard3e5bb8e2001-06-27 16:34:34 +0000355 diff $(srcdir)/result/$$name result.$$name ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000356 $(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 +0000357 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000358 diff result.$$name result2.$$name` ; \
359 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard3e5bb8e2001-06-27 16:34:34 +0000360 rm result.$$name result2.$$name ; \
361 fi ; fi ; done)
Daniel Veillard01791d51998-07-24 19:24:09 +0000362
Daniel Veillard3b7840c2003-09-11 23:42:01 +0000363NStests : xmllint$(EXEEXT)
364 @(echo > .memdump)
Daniel Veillard3b7840c2003-09-11 23:42:01 +0000365 @echo "## XML Namespaces regression tests"
Daniel Veillard3b7840c2003-09-11 23:42:01 +0000366 -@(for i in $(srcdir)/test/namespaces/* ; do \
367 name=`basename $$i`; \
368 if [ ! -d $$i ] ; then \
369 if [ ! -f $(srcdir)/result/namespaces/$$name ] ; then \
370 echo New test file $$name ; \
371 $(CHECKER) $(top_builddir)/xmllint $$i \
372 2> $(srcdir)/result/namespaces/$$name.err \
373 > $(srcdir)/result/namespaces/$$name ; \
374 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
375 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000376 log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \
Daniel Veillard3b7840c2003-09-11 23:42:01 +0000377 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
378 diff $(srcdir)/result/namespaces/$$name result.$$name ; \
Daniel Veillard03a53c32004-10-26 16:06:51 +0000379 diff $(srcdir)/result/namespaces/$$name.err error.$$name`; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000380 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard3b7840c2003-09-11 23:42:01 +0000381 rm result.$$name error.$$name ; \
382 fi ; fi ; done)
383
Daniel Veillard67f8b1c2004-04-09 21:51:49 +0000384IDtests : xmllint$(EXEEXT) testXPath$(EXEEXT)
385 @(echo > .memdump)
386 @echo "## xml:id regression tests"
387 -@(for i in $(srcdir)/test/xmlid/id_*.xml ; do \
388 name=`basename $$i`; \
389 if [ ! -d $$i ] ; then \
390 if [ ! -f $(srcdir)/result/xmlid/$$name ] ; then \
391 echo New test file $$name ; \
392 $(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" \
393 2> $(srcdir)/result/xmlid/$$name.err \
394 > $(srcdir)/result/xmlid/$$name ; \
395 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
396 else \
397 log=`$(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" 2> error.$$name > result.$$name ; \
398 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
399 diff $(srcdir)/result/xmlid/$$name result.$$name ; \
400 diff $(srcdir)/result/xmlid/$$name.err error.$$name` ; \
401 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
402 rm result.$$name error.$$name ; \
403 fi ; fi ; done)
404
Daniel Veillard522bc602004-02-21 11:53:09 +0000405Errtests : xmllint$(EXEEXT)
406 @(echo > .memdump)
407 @echo "## Error cases regression tests"
408 -@(for i in $(srcdir)/test/errors/*.xml ; do \
409 name=`basename $$i`; \
410 if [ ! -d $$i ] ; then \
411 if [ ! -f $(srcdir)/result/errors/$$name ] ; then \
412 echo New test file $$name ; \
413 $(CHECKER) $(top_builddir)/xmllint $$i \
414 2> $(srcdir)/result/errors/$$name.err \
415 > $(srcdir)/result/errors/$$name ; \
416 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
417 else \
418 log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \
419 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
420 diff $(srcdir)/result/errors/$$name result.$$name ; \
421 diff $(srcdir)/result/errors/$$name.err error.$$name` ; \
422 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
423 rm result.$$name error.$$name ; \
424 fi ; fi ; done)
425 @echo "## Error cases stream regression tests"
426 -@(for i in $(srcdir)/test/errors/*.xml ; do \
427 name=`basename $$i`; \
428 if [ ! -d $$i ] ; then \
429 if [ ! -f $(srcdir)/result/errors/$$name.str ] ; then \
430 echo New test file $$name ; \
Daniel Veillard4a14fb82004-06-14 19:58:20 +0000431 $(CHECKER) $(top_builddir)/xmllint --stream $$i \
Daniel Veillard522bc602004-02-21 11:53:09 +0000432 2> $(srcdir)/result/errors/$$name.str \
Daniel Veillardb8590d42005-01-21 15:10:23 +0000433 > /dev/null ; \
Daniel Veillard522bc602004-02-21 11:53:09 +0000434 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
435 else \
Daniel Veillardb8590d42005-01-21 15:10:23 +0000436 log=`$(CHECKER) $(top_builddir)/xmllint --stream $$i 2> error.$$name > /dev/null ; \
Daniel Veillard522bc602004-02-21 11:53:09 +0000437 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard522bc602004-02-21 11:53:09 +0000438 diff $(srcdir)/result/errors/$$name.str error.$$name` ; \
439 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb8590d42005-01-21 15:10:23 +0000440 rm error.$$name ; \
Daniel Veillard522bc602004-02-21 11:53:09 +0000441 fi ; fi ; done)
442
Daniel Veillard07be19b2002-02-08 14:20:35 +0000443Docbtests : xmllint$(EXEEXT)
Daniel Veillard89cad532001-10-22 09:46:13 +0000444
Daniel Veillard07be19b2002-02-08 14:20:35 +0000445XMLenttests : xmllint$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000446 @(echo > .memdump)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000447 @echo "## XML entity subst regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000448 -@(for i in $(srcdir)/test/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000449 name=`basename $$i`; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000450 if [ ! -d $$i ] ; then \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000451 if [ ! -f $(srcdir)/result/noent/$$name ] ; then \
452 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000453 $(CHECKER) $(top_builddir)/xmllint --noent $$i > $(srcdir)/result/noent/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000454 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000455 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000456 log=`$(CHECKER) $(top_builddir)/xmllint --noent $$i 2>&1 > result.$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000457 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000458 diff $(srcdir)/result/noent/$$name result.$$name ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000459 $(CHECKER) $(top_builddir)/xmllint --noent result.$$name 2>&1 > result2.$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000460 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000461 diff result.$$name result2.$$name` ; \
462 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000463 rm result.$$name result2.$$name ; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000464 fi ; fi ; done)
465
Daniel Veillard07be19b2002-02-08 14:20:35 +0000466URItests : testURI$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000467 @(echo > .memdump)
Daniel Veillard98a79162000-09-04 11:15:39 +0000468 @echo "## URI module regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000469 -@(for i in $(srcdir)/test/URI/*.data ; do \
Daniel Veillard98a79162000-09-04 11:15:39 +0000470 name=`basename $$i`; \
471 if [ ! -d $$i ] ; then \
472 if [ ! -f $(srcdir)/result/URI/$$name ] ; then \
473 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000474 $(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 +0000475 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard98a79162000-09-04 11:15:39 +0000476 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000477 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 +0000478 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000479 diff $(srcdir)/result/URI/$$name result.$$name` ; \
480 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard98a79162000-09-04 11:15:39 +0000481 rm result.$$name ; \
482 fi ; fi ; done)
Daniel Veillard36065812002-01-24 15:02:46 +0000483 -@(for i in $(srcdir)/test/URI/*.uri ; do \
Daniel Veillardb6e7fdb2001-02-02 17:07:32 +0000484 name=`basename $$i`; \
485 if [ ! -d $$i ] ; then \
486 if [ ! -f $(srcdir)/result/URI/$$name ] ; then \
487 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000488 $(CHECKER) $(top_builddir)/testURI < $$i > $(srcdir)/result/URI/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000489 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillardb6e7fdb2001-02-02 17:07:32 +0000490 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000491 log=`$(CHECKER) $(top_builddir)/testURI < $$i 2>&1 > result.$$name ; \
Daniel Veillardb6e7fdb2001-02-02 17:07:32 +0000492 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000493 diff $(srcdir)/result/URI/$$name result.$$name` ; \
494 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb6e7fdb2001-02-02 17:07:32 +0000495 rm result.$$name ; \
496 fi ; fi ; done)
Daniel Veillard98a79162000-09-04 11:15:39 +0000497
Daniel Veillard07be19b2002-02-08 14:20:35 +0000498XPathtests : testXPath$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000499 @(echo > .memdump)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000500 @echo "## XPath regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000501 -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \
Daniel Veillard017b1082001-06-21 11:20:21 +0000502 then echo Skipping debug not compiled in ; exit 0 ; fi ; \
503 for i in $(srcdir)/test/XPath/expr/* ; do \
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000504 name=`basename $$i`; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000505 if [ ! -d $$i ] ; then \
506 if [ ! -f $(srcdir)/result/XPath/expr/$$name ] ; then \
507 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000508 $(CHECKER) $(top_builddir)/testXPath -f --expr $$i > $(srcdir)/result/XPath/expr/$$name ; \
Daniel Veillard9e7160d2001-03-18 23:17:47 +0000509 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000510 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000511 log=`$(CHECKER) $(top_builddir)/testXPath -f --expr $$i 2>&1 > result.$$name ; \
Daniel Veillard9e7160d2001-03-18 23:17:47 +0000512 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000513 diff $(srcdir)/result/XPath/expr/$$name result.$$name` ; \
514 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000515 rm result.$$name ; \
Daniel Veillard017b1082001-06-21 11:20:21 +0000516 fi ; fi ; done ; \
517 for i in $(srcdir)/test/XPath/docs/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000518 if [ ! -d $$i ] ; then \
519 doc=`basename $$i`; \
520 for j in $(srcdir)/test/XPath/tests/$$doc* ; do \
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000521 if [ ! -f $$j ] ; then continue ; fi ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000522 name=`basename $$j`; \
523 if [ ! -d $$j ] ; then \
524 if [ ! -f $(srcdir)/result/XPath/tests/$$name ] ; then \
525 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000526 $(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j > $(srcdir)/result/XPath/tests/$$name ; \
Daniel Veillard9e7160d2001-03-18 23:17:47 +0000527 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000528 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000529 log=`$(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j 2>&1 > result.$$name ; \
Daniel Veillard9e7160d2001-03-18 23:17:47 +0000530 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000531 diff $(srcdir)/result/XPath/tests/$$name result.$$name` ; \
532 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000533 rm result.$$name ; \
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000534 fi ; fi ; done ; fi ; done)
535
Daniel Veillard07be19b2002-02-08 14:20:35 +0000536XPtrtests : testXPath$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000537 @(echo > .memdump)
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000538 @echo "## XPointer regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000539 -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \
Daniel Veillard017b1082001-06-21 11:20:21 +0000540 then echo Skipping debug not compiled in ; exit 0 ; fi ; \
541 for i in $(srcdir)/test/XPath/docs/* ; do \
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000542 if [ ! -d $$i ] ; then \
543 doc=`basename $$i`; \
544 for j in $(srcdir)/test/XPath/xptr/$$doc* ; do \
545 if [ ! -f $$j ] ; then continue ; fi ; \
546 name=`basename $$j`; \
547 if [ ! -d $$j ] ; then \
548 if [ ! -f $(srcdir)/result/XPath/xptr/$$name ] ; then \
549 echo New test file $$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000550 $(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j > $(srcdir)/result/XPath/xptr/$$name ; \
551 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000552 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000553 log=`$(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j 2>&1 > result.$$name ; \
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000554 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000555 diff $(srcdir)/result/XPath/xptr/$$name result.$$name` ; \
556 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000557 rm result.$$name ; \
558 fi ; fi ; done ; fi ; done)
559
Daniel Veillard07be19b2002-02-08 14:20:35 +0000560XIncludetests : xmllint$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000561 @(echo > .memdump)
Daniel Veillardbf432752000-11-12 15:56:56 +0000562 @echo "## XInclude regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000563 -@(for i in $(srcdir)/test/XInclude/docs/* ; do \
Daniel Veillardbf432752000-11-12 15:56:56 +0000564 name=`basename $$i`; \
565 if [ ! -d $$i ] ; then \
566 if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \
567 echo New test file $$name ; \
Daniel Veillarde74d2e12003-12-09 11:35:37 +0000568 $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000569 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardbf432752000-11-12 15:56:56 +0000570 else \
Daniel Veillard1f8658a2004-08-14 21:46:31 +0000571 log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > result.$$name 2>error.$$name ; \
Daniel Veillardbf432752000-11-12 15:56:56 +0000572 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillarde74d2e12003-12-09 11:35:37 +0000573 diff $(srcdir)/result/XInclude/$$name result.$$name ; \
574 diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000575 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillarde74d2e12003-12-09 11:35:37 +0000576 rm result.$$name error.$$name ; \
Daniel Veillardbf432752000-11-12 15:56:56 +0000577 fi ; fi ; done)
Daniel Veillardc14c3892004-08-16 12:34:50 +0000578 -@(for i in $(srcdir)/test/XInclude/docs/* ; do \
579 name=`basename $$i`; \
580 if [ ! -d $$i ] ; then \
581 if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \
582 echo New test file $$name ; \
583 $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \
584 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
585 else \
586 log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > result.$$name 2>error.$$name ; \
587 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
588 diff $(srcdir)/result/XInclude/$$name result.$$name ; \
589 diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \
590 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
591 rm result.$$name error.$$name ; \
592 fi ; fi ; done)
Daniel Veillard7899c5c2003-11-03 12:31:38 +0000593 @(echo > .memdump)
594 @echo "## XInclude xmlReader regression tests"
595 -@(for i in $(srcdir)/test/XInclude/docs/* ; do \
596 name=`basename $$i`; \
597 if [ ! -d $$i ] ; then \
598 if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \
599 echo New test file $$name ; \
William M. Brackf20fbf72004-06-25 05:49:08 +0000600 $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \
Daniel Veillard7899c5c2003-11-03 12:31:38 +0000601 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
602 else \
Daniel Veillard1f8658a2004-08-14 21:46:31 +0000603 log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \
Daniel Veillard7899c5c2003-11-03 12:31:38 +0000604 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillarde74d2e12003-12-09 11:35:37 +0000605 diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \
Daniel Veillard7899c5c2003-11-03 12:31:38 +0000606 diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \
607 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillarde74d2e12003-12-09 11:35:37 +0000608 rm result.$$name error.$$name ; \
Daniel Veillard7899c5c2003-11-03 12:31:38 +0000609 fi ; fi ; done)
Daniel Veillardc14c3892004-08-16 12:34:50 +0000610 -@(for i in $(srcdir)/test/XInclude/docs/* ; do \
611 name=`basename $$i`; \
612 if [ ! -d $$i ] ; then \
613 if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \
614 echo New test file $$name ; \
615 $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \
616 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
617 else \
618 log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \
619 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
620 diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \
621 diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \
622 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
623 rm result.$$name error.$$name ; \
624 fi ; fi ; done)
Daniel Veillardbf432752000-11-12 15:56:56 +0000625
Daniel Veillard07be19b2002-02-08 14:20:35 +0000626Scripttests : xmllint$(EXEEXT)
Daniel Veillardb8c9be92001-07-09 16:01:19 +0000627 @(echo > .memdump)
Daniel Veillardb8c9be92001-07-09 16:01:19 +0000628 @echo "## Scripts regression tests"
629 @echo "## Some of the base computations may be different if srcdir != ."
Daniel Veillard36065812002-01-24 15:02:46 +0000630 -@(for i in $(srcdir)/test/scripts/*.script ; do \
Daniel Veillardb8c9be92001-07-09 16:01:19 +0000631 name=`basename $$i .script`; \
632 xml=$(srcdir)/test/scripts/`basename $$i .script`.xml; \
633 if [ -f $$xml ] ; then \
634 if [ ! -f $(srcdir)/result/scripts/$$name ] ; then \
635 echo New test file $$name ; \
Daniel Veillard29b17482004-08-16 00:39:03 +0000636 $(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > $(srcdir)/result/scripts/$$name 2> $(srcdir)/result/scripts/$$name.err ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000637 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb8c9be92001-07-09 16:01:19 +0000638 else \
Daniel Veillard29b17482004-08-16 00:39:03 +0000639 log=`$(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > result.$$name 2> result.$$name.err ; \
Daniel Veillardb8c9be92001-07-09 16:01:19 +0000640 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard29b17482004-08-16 00:39:03 +0000641 diff $(srcdir)/result/scripts/$$name result.$$name ; \
642 diff $(srcdir)/result/scripts/$$name.err result.$$name.err` ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000643 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard29b17482004-08-16 00:39:03 +0000644 rm result.$$name result.$$name.err ; \
Daniel Veillardb8c9be92001-07-09 16:01:19 +0000645 fi ; fi ; done)
646
Daniel Veillard07be19b2002-02-08 14:20:35 +0000647Catatests : xmlcatalog$(EXEEXT)
Daniel Veillardcda96922001-08-21 10:56:31 +0000648 @(echo > .memdump)
Daniel Veillardcda96922001-08-21 10:56:31 +0000649 @echo "## Catalog regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000650 -@(for i in $(srcdir)/test/catalogs/*.script ; do \
Daniel Veillardcda96922001-08-21 10:56:31 +0000651 name=`basename $$i .script`; \
652 xml=$(srcdir)/test/catalogs/`basename $$i .script`.xml; \
653 if [ -f $$xml ] ; then \
654 if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
655 echo New test file $$name ; \
William M. Brackf20fbf72004-06-25 05:49:08 +0000656 $(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > $(srcdir)/result/catalogs/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000657 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardcda96922001-08-21 10:56:31 +0000658 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000659 log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > result.$$name ; \
Daniel Veillardcda96922001-08-21 10:56:31 +0000660 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000661 diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
662 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardcda96922001-08-21 10:56:31 +0000663 rm result.$$name ; \
664 fi ; fi ; done)
Daniel Veillard36065812002-01-24 15:02:46 +0000665 -@(for i in $(srcdir)/test/catalogs/*.script ; do \
Daniel Veillardc853b322001-11-06 15:24:37 +0000666 name=`basename $$i .script`; \
667 sgml=$(srcdir)/test/catalogs/`basename $$i .script`.sgml; \
668 if [ -f $$sgml ] ; then \
669 if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
670 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000671 $(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > $(srcdir)/result/catalogs/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000672 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardc853b322001-11-06 15:24:37 +0000673 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000674 log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000675 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000676 diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
677 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000678 rm result.$$name ; \
679 fi ; fi ; done)
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000680 @echo "## Add and del operations on XML Catalogs"
Daniel Veillard66651aa2002-11-15 11:21:43 +0000681 -@($(CHECKER) $(top_builddir)/xmlcatalog --create --noout $(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 $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid sysid $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000684 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000685 $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid2 sysid2 $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000686 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000687 $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid3 sysid3 $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000688 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000689 diff result/catalogs/mycatalog.full $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000690 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000691 $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000692 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000693 $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid3 $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000694 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000695 $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid2 $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000696 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000697 diff result/catalogs/mycatalog.empty $(srcdir)/result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000698 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard66651aa2002-11-15 11:21:43 +0000699 rm -f $(srcdir)/result/catalogs/mycatalog)
Daniel Veillardcda96922001-08-21 10:56:31 +0000700
Daniel Veillard07be19b2002-02-08 14:20:35 +0000701SVGtests : xmllint$(EXEEXT)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000702 @echo "## SVG parsing regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000703 -@(for i in $(srcdir)/test/SVG/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000704 name=`basename $$i`; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000705 if [ ! -d $$i ] ; then \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000706 if [ ! -f $(srcdir)/result/SVG/$$name ] ; then \
707 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000708 $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/SVG/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000709 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard011b63c1999-06-02 17:44:04 +0000710 else \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000711 echo Testing $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000712 $(CHECKER) $(top_builddir)/xmllint $$i > result.$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000713 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000714 diff $(srcdir)/result/SVG/$$name result.$$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000715 $(CHECKER) $(top_builddir)/xmllint result.$$name > result2.$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000716 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000717 diff result.$$name result2.$$name ; \
718 rm result.$$name result2.$$name ; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000719 fi ; fi ; done)
720
Daniel Veillard07be19b2002-02-08 14:20:35 +0000721Threadtests : testThreads$(EXEEXT)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000722 @echo "## Threaded regression tests"
Daniel Veillardbb5abab2003-10-03 22:21:51 +0000723 -@($(CHECKER) $(top_builddir)/testThreads ; \
724 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
725 exit 0)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000726
Daniel Veillard81514ba2003-09-16 23:17:26 +0000727Readertests : xmllint$(EXEEXT)
Daniel Veillard8a44e592003-09-15 14:50:06 +0000728 @(echo > .memdump)
Daniel Veillard8a44e592003-09-15 14:50:06 +0000729 @echo "## Reader regression tests"
Daniel Veillard8a44e592003-09-15 14:50:06 +0000730 -@(for i in $(srcdir)/test/* ; do \
731 name=`basename $$i`; \
732 if [ ! -d $$i ] ; then \
733 if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \
734 echo New test file $$name ; \
735 $(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \
736 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
737 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000738 log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
Daniel Veillard8a44e592003-09-15 14:50:06 +0000739 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000740 diff $(srcdir)/result/$$name.rdr result.$$name` ; \
741 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard8a44e592003-09-15 14:50:06 +0000742 rm result.$$name ; \
743 fi ; fi ; done)
Daniel Veillard53350552003-09-18 13:35:51 +0000744 @echo "## Reader on memory regression tests"
Daniel Veillard53350552003-09-18 13:35:51 +0000745 -@(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 --memory --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \
751 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
752 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000753 log=`$(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
Daniel Veillard53350552003-09-18 13:35:51 +0000754 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000755 diff $(srcdir)/result/$$name.rdr result.$$name` ; \
756 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard53350552003-09-18 13:35:51 +0000757 rm result.$$name ; \
758 fi ; fi ; done)
Daniel Veillard7899c5c2003-11-03 12:31:38 +0000759 @(echo > .memdump)
760 @echo "## Walker regression tests"
761 -@(for i in $(srcdir)/test/* ; do \
762 name=`basename $$i`; \
763 if [ ! -d $$i ] ; then \
764 if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \
765 echo New test file $$name ; \
766 $(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \
767 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
768 else \
769 log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > result.$$name 2>/dev/null ; \
770 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
771 diff $(srcdir)/result/$$name.rdr result.$$name` ; \
772 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
773 rm result.$$name ; \
774 fi ; fi ; done)
Daniel Veillard0df3bc32004-06-08 12:03:41 +0000775 @echo "## Reader entities substitution regression tests"
776 -@(for i in $(srcdir)/test/* ; do \
777 name=`basename $$i`; \
778 if [ ! -d $$i ] ; then \
779 if [ ! -f $(srcdir)/result/$$name.rde ] ; then \
780 echo New test file $$name ; \
781 $(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > $(srcdir)/result/$$name.rde 2>/dev/null ; \
782 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
783 else \
784 log=`$(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
785 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
786 diff $(srcdir)/result/$$name.rde result.$$name` ; \
787 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
788 rm result.$$name ; \
789 fi ; fi ; done)
790
Daniel Veillard07be19b2002-02-08 14:20:35 +0000791SAXtests : testSAX$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000792 @(echo > .memdump)
Daniel Veillard4a5a9642005-06-27 10:40:55 +0000793 @echo "## SAX1 callbacks regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000794 -@(for i in $(srcdir)/test/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000795 name=`basename $$i`; \
796 if [ ! -d $$i ] ; then \
Daniel Veillard4b1577f2003-09-03 13:10:37 +0000797 if [ ! -f $(srcdir)/result/$$name.sax ] ; then \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000798 echo New test file $$name ; \
Daniel Veillardf403d292003-10-05 13:51:35 +0000799 $(CHECKER) $(top_builddir)/testSAX $$i > $(srcdir)/result/$$name.sax 2> /dev/null ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000800 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000801 else \
Daniel Veillardf403d292003-10-05 13:51:35 +0000802 log=`$(CHECKER) $(top_builddir)/testSAX $$i > result.$$name 2> /dev/null ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000803 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000804 diff $(srcdir)/result/$$name.sax result.$$name` ; \
805 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000806 rm result.$$name ; \
807 fi ; fi ; done)
Daniel Veillard4a5a9642005-06-27 10:40:55 +0000808 @echo "## SAX2 callbacks regression tests"
809 -@(for i in $(srcdir)/test/* ; do \
810 name=`basename $$i`; \
811 if [ ! -d $$i ] ; then \
812 if [ ! -f $(srcdir)/result/$$name.sax2 ] ; then \
813 echo New test file $$name ; \
814 $(CHECKER) $(top_builddir)/testSAX --sax2 $$i > $(srcdir)/result/$$name.sax2 2> /dev/null ; \
815 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
816 else \
817 log=`$(CHECKER) $(top_builddir)/testSAX --sax2 $$i > result.$$name 2> /dev/null ; \
818 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
819 diff $(srcdir)/result/$$name.sax2 result.$$name` ; \
820 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
821 rm result.$$name ; \
822 fi ; fi ; done)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +0000823
Daniel Veillard07be19b2002-02-08 14:20:35 +0000824Validtests : xmllint$(EXEEXT)
Daniel Veillard357c9602001-05-03 10:49:20 +0000825 @(echo > .memdump)
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000826 @echo "## Valid documents regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000827 -@(for i in $(srcdir)/test/VCM/* ; do \
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000828 name=`basename $$i`; \
829 if [ ! -d $$i ] ; then \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000830 log=`$(CHECKER) $(top_builddir)/xmllint --valid --noout --nowarning $$i ; \
831 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`;\
832 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000833 fi ; done ; exit 0)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000834 @echo "## Validity checking regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000835 -@(for i in $(srcdir)/test/VC/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000836 name=`basename $$i`; \
837 if [ ! -d $$i ] ; then \
838 if [ ! -f $(srcdir)/result/VC/$$name ] ; then \
839 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000840 $(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> $(srcdir)/result/VC/$$name ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000841 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000842 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000843 log=`$(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> result.$$name ; \
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000844 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000845 diff $(srcdir)/result/VC/$$name result.$$name` ; \
846 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000847 rm result.$$name ; \
848 fi ; fi ; done)
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000849 @echo "## General documents valid regression tests"
Daniel Veillard36065812002-01-24 15:02:46 +0000850 -@(for i in $(srcdir)/test/valid/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000851 name=`basename $$i`; \
852 if [ ! -d $$i ] ; then \
853 if [ ! -f $(srcdir)/result/valid/$$name ] ; then \
854 echo New test file $$name ; \
Daniel Veillard4b3a84f2002-03-19 14:36:46 +0000855 $(CHECKER) $(top_builddir)/xmllint --valid $$i > $(srcdir)/result/valid/$$name 2>$(srcdir)/result/valid/$$name.err ; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000856 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000857 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000858 log=`$(CHECKER) $(top_builddir)/xmllint --valid $$i > result.$$name 2>error.$$name ; \
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000859 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000860 diff $(srcdir)/result/valid/$$name result.$$name ; \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000861 diff $(srcdir)/result/valid/$$name.err error.$$name` ; \
862 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard35008381999-10-25 13:15:52 +0000863 rm result.$$name error.$$name ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000864 fi ; fi ; done)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +0000865
Daniel Veillard4255d502002-04-16 15:50:10 +0000866Regexptests: testRegexp$(EXEEXT)
867 @(echo > .memdump)
Daniel Veillard4255d502002-04-16 15:50:10 +0000868 @echo "## Regexp regression tests"
Daniel Veillard4255d502002-04-16 15:50:10 +0000869 -@(for i in $(srcdir)/test/regexp/* ; do \
870 name=`basename $$i`; \
871 if [ ! -d $$i ] ; then \
872 if [ ! -f $(srcdir)/result/regexp/$$name ] ; then \
873 echo New test file $$name ; \
874 $(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000875 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard4255d502002-04-16 15:50:10 +0000876 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000877 log=`$(CHECKER) $(top_builddir)/testRegexp -i $$i 2>&1 > result.$$name ; \
Daniel Veillard4255d502002-04-16 15:50:10 +0000878 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000879 diff $(srcdir)/result/regexp/$$name result.$$name` ; \
880 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard4255d502002-04-16 15:50:10 +0000881 rm result.$$name ; \
882 fi ; fi ; done)
Daniel Veillard355a0232005-08-22 12:58:05 +0000883 @echo "## Formal expresssions regression tests"
884 -@(for i in $(srcdir)/test/expr/* ; do \
885 name=`basename $$i`; \
886 if [ ! -d $$i ] ; then \
887 if [ ! -f $(srcdir)/result/expr/$$name ] ; then \
888 echo New test file $$name ; \
889 $(CHECKER) $(top_builddir)/testRegexp --expr -i $$i > $(srcdir)/result/expr/$$name; \
890 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
891 else \
892 log=`$(CHECKER) $(top_builddir)/testRegexp --expr -i $$i 2>&1 > result.$$name ; \
893 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
894 diff $(srcdir)/result/expr/$$name result.$$name` ; \
895 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
896 rm result.$$name ; \
897 fi ; fi ; done)
Daniel Veillard4255d502002-04-16 15:50:10 +0000898
899Automatatests: testAutomata$(EXEEXT)
900 @(echo > .memdump)
Daniel Veillard4255d502002-04-16 15:50:10 +0000901 @echo "## Automata regression tests"
Daniel Veillard4255d502002-04-16 15:50:10 +0000902 -@(for i in $(srcdir)/test/automata/* ; do \
903 name=`basename $$i`; \
904 if [ ! -d $$i ] ; then \
905 if [ ! -f $(srcdir)/result/automata/$$name ] ; then \
906 echo New test file $$name ; \
907 $(CHECKER) $(top_builddir)/testAutomata $$i > $(srcdir)/result/automata/$$name; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000908 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard4255d502002-04-16 15:50:10 +0000909 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000910 log=`$(CHECKER) $(top_builddir)/testAutomata $$i 2>&1 > result.$$name ; \
Daniel Veillard4255d502002-04-16 15:50:10 +0000911 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000912 diff $(srcdir)/result/automata/$$name result.$$name` ; \
913 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
Daniel Veillard4255d502002-04-16 15:50:10 +0000914 rm result.$$name ; \
915 fi ; fi ; done)
916
Daniel Veillard9ebb6322008-01-11 07:19:24 +0000917dba100000.xml: dbgenattr.pl
Daniel Veillardf6bc7c22003-09-17 22:33:22 +0000918 @echo "## generating dba100000.xml"
Daniel Veillard9ebb6322008-01-11 07:19:24 +0000919 @($(PERL) $(top_srcdir)/dbgenattr.pl 100000 > dba100000.xml)
Daniel Veillardf6bc7c22003-09-17 22:33:22 +0000920
Daniel Veillard9ebb6322008-01-11 07:19:24 +0000921Timingtests: xmllint$(EXEEXT) dba100000.xml
Daniel Veillardf6bc7c22003-09-17 22:33:22 +0000922 @echo "## Timing tests to try to detect performance"
923 @echo "## as well a memory usage breakage when streaming"
Daniel Veillarde96a2a42003-09-24 21:23:56 +0000924 @echo "## 1/ using the file interface"
925 @echo "## 2/ using the memory interface"
926 @echo "## 3/ repeated DOM parsing"
927 @echo "## 4/ repeated DOM validation"
Daniel Veillard9ebb6322008-01-11 07:19:24 +0000928 -@($(top_builddir)/xmllint --stream --timing dba100000.xml; \
Daniel Veillardd9e9c9d2003-09-18 22:03:46 +0000929 MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
930 if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
Daniel Veillardf6bc7c22003-09-17 22:33:22 +0000931 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
932 exit 0)
Daniel Veillard9ebb6322008-01-11 07:19:24 +0000933 -@($(top_builddir)/xmllint --stream --timing --memory dba100000.xml; \
Daniel Veillardd9e9c9d2003-09-18 22:03:46 +0000934 MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
935 if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
Daniel Veillardf6bc7c22003-09-17 22:33:22 +0000936 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
937 exit 0)
Daniel Veillardc74859e2004-02-26 09:57:32 +0000938 -@($(top_builddir)/xmllint --noout --timing --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
Daniel Veillarde96a2a42003-09-24 21:23:56 +0000939 MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
940 if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
941 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
942 exit 0)
Daniel Veillard4432df22003-09-28 18:58:27 +0000943
944VTimingtests: xmllint$(EXEEXT)
Daniel Veillardc74859e2004-02-26 09:57:32 +0000945 -@($(top_builddir)/xmllint --noout --timing --valid --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
Daniel Veillarde96a2a42003-09-24 21:23:56 +0000946 MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
947 if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
948 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
949 exit 0)
Daniel Veillardf6bc7c22003-09-17 22:33:22 +0000950
Aleksey Sanin508a1012002-05-31 06:32:32 +0000951C14Ntests : testC14N$(EXEEXT)
Aleksey Saninf8cb6dd2002-06-04 04:27:06 +0000952 @echo "## C14N and XPath regression tests"
Aleksey Sanin83868242009-07-09 10:26:22 +0200953 -@(for m in with-comments without-comments 1-1-without-comments exc-without-comments ; do \
Aleksey Sanin508a1012002-05-31 06:32:32 +0000954 for i in $(srcdir)/test/c14n/$$m/*.xml ; do \
955 if [ ! -d $$i ] ; then \
956 name=`basename $$i .xml`; \
Aleksey Saninf8cb6dd2002-06-04 04:27:06 +0000957 cmdline="$(CHECKER) $(top_builddir)/testC14N --$$m $$i"; \
Daniel Veillard63186732002-10-15 08:43:17 +0000958 if [ -f $(srcdir)/test/c14n/$$m/$$name.xpath ] ; then \
Aleksey Saninf8cb6dd2002-06-04 04:27:06 +0000959 cmdline="$$cmdline $(srcdir)/test/c14n/$$m/$$name.xpath"; \
Daniel Veillard63186732002-10-15 08:43:17 +0000960 if [ -f $(srcdir)/test/c14n/$$m/$$name.ns ] ; then \
Aleksey Saninf8cb6dd2002-06-04 04:27:06 +0000961 cmdline="$$cmdline '`cat $(srcdir)/test/c14n/$$m/$$name.ns`'"; \
962 fi; \
Aleksey Sanin508a1012002-05-31 06:32:32 +0000963 fi; \
Aleksey Saninf8cb6dd2002-06-04 04:27:06 +0000964 $$cmdline > $(srcdir)/test/c14n/test.tmp; \
Aleksey Sanin508a1012002-05-31 06:32:32 +0000965 if [ $$? -eq 0 ]; then \
Aleksey Saninc57f9c12002-05-31 19:14:57 +0000966 diff $(srcdir)/result/c14n/$$m/$$name $(srcdir)/test/c14n/test.tmp; \
Aleksey Sanin508a1012002-05-31 06:32:32 +0000967 if [ $$? -ne 0 ]; then \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000968 echo "Test $$m/$$name failed"; \
Aleksey Saninf8cb6dd2002-06-04 04:27:06 +0000969 cat $(srcdir)/test/c14n/test.tmp; \
Aleksey Sanin508a1012002-05-31 06:32:32 +0000970 fi; \
971 else \
972 echo "C14N failed"; \
973 fi; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000974 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Aleksey Sanin508a1012002-05-31 06:32:32 +0000975 fi; \
976 rm -f $(srcdir)/test/c14n/test.tmp; \
977 done; \
978 done)
Daniel Veillard4255d502002-04-16 15:50:10 +0000979
980Schemastests: testSchemas$(EXEEXT)
981 @(echo > .memdump)
Daniel Veillard4255d502002-04-16 15:50:10 +0000982 @echo "## Schemas regression tests"
Daniel Veillard8651f532002-04-17 09:06:27 +0000983 -@(for i in $(srcdir)/test/schemas/*_*.xsd ; do \
984 name=`basename $$i | sed 's+_.*++'`; \
985 sno=`basename $$i | sed 's+.*_\(.*\).xsd+\1+'`; \
986 for j in $(srcdir)/test/schemas/"$$name"_*.xml ; do \
Daniel Veillard5add8682003-03-10 13:13:58 +0000987 if [ -f $$j ] ; then \
Daniel Veillard8651f532002-04-17 09:06:27 +0000988 xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
989 if [ ! -f $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" ]; \
990 then \
Daniel Veillard6231e842002-04-18 11:54:04 +0000991 echo New test file "$$name"_"$$sno"_"$$xno" ; \
Daniel Veillard8651f532002-04-17 09:06:27 +0000992 $(CHECKER) $(top_builddir)/testSchemas $$i $$j \
993 > $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \
994 2> $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err; \
Daniel Veillard07cb8222003-09-10 10:51:05 +0000995 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard8651f532002-04-17 09:06:27 +0000996 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +0000997 log=`$(CHECKER) $(top_builddir)/testSchemas $$i $$j \
Daniel Veillard8651f532002-04-17 09:06:27 +0000998 > res.$$name 2> err.$$name;\
999 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
1000 diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \
1001 res.$$name;\
1002 diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err \
1003 err.$$name;\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +00001004 grep Unimplemented err.$$name`; \
1005 if [ -n "$$log" ] ; then echo "$$name"_"$$sno"_"$$xno" result ; echo $$log ; fi ; \
Daniel Veillard8651f532002-04-17 09:06:27 +00001006 rm res.$$name err.$$name ; \
Daniel Veillard5add8682003-03-10 13:13:58 +00001007 fi ; fi ;\
Daniel Veillard8651f532002-04-17 09:06:27 +00001008 done; done)
Daniel Veillard4255d502002-04-16 15:50:10 +00001009
Daniel Veillard71531f32003-02-05 13:19:53 +00001010Relaxtests: xmllint$(EXEEXT)
Daniel Veillard6eadf632003-01-23 18:29:16 +00001011 @(echo > .memdump)
Daniel Veillard6eadf632003-01-23 18:29:16 +00001012 @echo "## Relax-NG regression tests"
Daniel Veillard6eadf632003-01-23 18:29:16 +00001013 -@(for i in $(srcdir)/test/relaxng/*.rng ; do \
1014 name=`basename $$i | sed 's+\.rng++'`; \
Daniel Veillard231d7912003-02-09 14:22:17 +00001015 if [ ! -f $(srcdir)/result/relaxng/"$$name"_valid ] ; then \
1016 echo New schemas $$name ; \
1017 $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \
1018 > $(srcdir)/result/relaxng/"$$name"_valid \
1019 2> $(srcdir)/result/relaxng/"$$name"_err; \
Daniel Veillard07cb8222003-09-10 10:51:05 +00001020 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard231d7912003-02-09 14:22:17 +00001021 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +00001022 log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \
Daniel Veillard231d7912003-02-09 14:22:17 +00001023 > res.$$name 2> err.$$name;\
1024 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
1025 diff $(srcdir)/result/relaxng/"$$name"_valid \
1026 res.$$name;\
1027 diff $(srcdir)/result/relaxng/"$$name"_err \
1028 err.$$name | grep -v "error detected at";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +00001029 grep Unimplemented err.$$name`; \
1030 if [ -n "$$log" ] ; then echo schemas $$name result ; echo $$log ; fi ; \
Daniel Veillard231d7912003-02-09 14:22:17 +00001031 rm res.$$name err.$$name ; \
1032 fi; \
Daniel Veillard6eadf632003-01-23 18:29:16 +00001033 for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \
1034 if [ -f $$j ] ; then \
1035 xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
1036 if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \
1037 then \
1038 echo New test file "$$name"_"$$xno" ; \
Daniel Veillard71531f32003-02-05 13:19:53 +00001039 $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \
Daniel Veillard6eadf632003-01-23 18:29:16 +00001040 > $(srcdir)/result/relaxng/"$$name"_"$$xno" \
1041 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \
Daniel Veillard07cb8222003-09-10 10:51:05 +00001042 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard6eadf632003-01-23 18:29:16 +00001043 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +00001044 log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \
Daniel Veillard6eadf632003-01-23 18:29:16 +00001045 > res.$$name 2> err.$$name;\
1046 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
1047 diff $(srcdir)/result/relaxng/"$$name"_"$$xno" \
1048 res.$$name;\
1049 diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \
Daniel Veillardd41f4f42003-01-29 21:07:52 +00001050 err.$$name | grep -v "error detected at";\
Daniel Veillard2b8c4a12003-10-02 22:28:19 +00001051 grep Unimplemented err.$$name`; \
1052 if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \
Daniel Veillard6eadf632003-01-23 18:29:16 +00001053 rm res.$$name err.$$name ; \
1054 fi ; fi ; \
1055 done; done)
Daniel Veillardf4e55762003-04-15 23:32:22 +00001056 @echo "## Relax-NG streaming regression tests"
Daniel Veillardf4e55762003-04-15 23:32:22 +00001057 -@(for i in $(srcdir)/test/relaxng/*.rng ; do \
1058 name=`basename $$i | sed 's+\.rng++'`; \
1059 for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \
1060 if [ -f $$j ] ; then \
1061 xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
1062 if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \
1063 then \
1064 echo New test file "$$name"_"$$xno" ; \
1065 $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \
1066 > $(srcdir)/result/relaxng/"$$name"_"$$xno" \
1067 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \
Daniel Veillard07cb8222003-09-10 10:51:05 +00001068 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardf4e55762003-04-15 23:32:22 +00001069 else \
Daniel Veillard2b8c4a12003-10-02 22:28:19 +00001070 log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --stream --relaxng $$i $$j \
Daniel Veillardf4e55762003-04-15 23:32:22 +00001071 > res.$$name 2> err.$$name;\
1072 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardbb5abab2003-10-03 22:21:51 +00001073 diff $(srcdir)/result/relaxng/"$$name"_"$$xno" res.$$name;\
Daniel Veillardec18c962009-08-26 18:37:43 +02001074 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 +00001075 diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \
1076 err.$$name | grep -v "error detected at";\
1077 fi ; grep Unimplemented err.$$name`; \
William M. Bracka0c48ad2004-04-16 15:58:29 +00001078 if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \
Daniel Veillardf4e55762003-04-15 23:32:22 +00001079 rm res.$$name err.$$name ; \
1080 fi ; fi ; \
1081 done; done)
Daniel Veillard6eadf632003-01-23 18:29:16 +00001082
Daniel Veillardc740a172005-07-31 12:17:24 +00001083Schematrontests: xmllint$(EXEEXT)
1084 @(echo > .memdump)
1085 @echo "## Schematron regression tests"
1086 -@(for i in $(srcdir)/test/schematron/*.sct ; do \
1087 name=`basename $$i | sed 's+\.sct++'`; \
1088 for j in $(srcdir)/test/schematron/"$$name"_*.xml ; do \
1089 if [ -f $$j ] ; then \
1090 xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
1091 if [ ! -f $(srcdir)/result/schematron/"$$name"_"$$xno" ]; \
1092 then \
1093 echo New test file "$$name"_"$$xno" ; \
1094 $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
1095 > $(srcdir)/result/schematron/"$$name"_"$$xno" \
1096 2> $(srcdir)/result/schematron/"$$name"_"$$xno".err; \
1097 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
1098 else \
1099 log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
1100 > res.$$name 2> err.$$name;\
1101 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
1102 diff $(srcdir)/result/schematron/"$$name"_"$$xno" \
1103 res.$$name;\
1104 diff $(srcdir)/result/schematron/"$$name"_"$$xno".err \
1105 err.$$name | grep -v "error detected at";\
1106 grep Unimplemented err.$$name`; \
1107 if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \
1108 rm res.$$name err.$$name ; \
1109 fi ; fi ; \
1110 done; done)
1111
Daniel Veillard6dc91962004-03-22 19:10:02 +00001112RelaxNGPythonTests:
1113 @(if [ -x $(PYTHON) ] ; then \
Daniel Veillard6d38c752004-05-10 00:40:51 +00001114 PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH ; \
William M. Brackf5806742004-03-31 02:01:32 +00001115 export PYTHONPATH; \
William M. Bracka22da292005-02-12 01:08:22 +00001116 LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
1117 export LD_LIBRARY_PATH; \
Daniel Veillard6dc91962004-03-22 19:10:02 +00001118 echo "## Relax-NG Python based test suite 1" ; \
Daniel Veillard252004d2004-03-23 12:32:32 +00001119 $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite.py ; \
Daniel Veillard6dc91962004-03-22 19:10:02 +00001120 echo "## Relax-NG Python based test suite 2" ; \
Daniel Veillard252004d2004-03-23 12:32:32 +00001121 $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite2.py ; \
Daniel Veillard6dc91962004-03-22 19:10:02 +00001122 fi)
1123
1124SchemasPythonTests:
1125 @(if [ -x $(PYTHON) ] ; then \
Daniel Veillard6d38c752004-05-10 00:40:51 +00001126 PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH; \
William M. Brackf5806742004-03-31 02:01:32 +00001127 export PYTHONPATH; \
William M. Bracka22da292005-02-12 01:08:22 +00001128 LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
1129 export LD_LIBRARY_PATH; \
Daniel Veillard6dc91962004-03-22 19:10:02 +00001130 echo "## XML Schemas datatypes Python based test suite" ; \
Kasimier T. Buchcik27759f22005-12-05 15:32:28 +00001131 echo "## It is normal to see 11 errors reported" ; \
Daniel Veillard252004d2004-03-23 12:32:32 +00001132 $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \
Daniel Veillard6dc91962004-03-22 19:10:02 +00001133 fi)
Daniel Richard G5706b6d2012-08-06 11:32:54 +08001134 @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" pytests ; fi)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001135
Daniel Veillardf9d16912005-01-30 22:36:30 +00001136Patterntests: xmllint$(EXEEXT)
1137 @(echo > .memdump)
1138 @echo "## Pattern regression tests"
1139 -@(for i in $(srcdir)/test/pattern/*.pat ; do \
1140 name=`basename $$i .pat`; \
1141 if [ -f $(srcdir)/test/pattern/$$name.xml ] ; then \
1142 if [ ! -f $(srcdir)/result/pattern/$$name ] ; then \
1143 rm -f result.$$name ; \
1144 echo New test file $$name ; \
1145 for pat in `cat $$i` ; do \
Daniel Veillardd4301ab2005-02-03 22:24:10 +00001146 $(CHECKER) $(top_builddir)/xmllint --walker --pattern $$pat $(srcdir)/test/pattern/$$name.xml >> $(srcdir)/result/pattern/$$name ; \
Daniel Veillardf9d16912005-01-30 22:36:30 +00001147 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
1148 done ;\
1149 else \
1150 rm -f result.$$name ; \
1151 lst=`cat $$i` ; \
Daniel Veillardd4301ab2005-02-03 22:24:10 +00001152 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 +00001153 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
1154 done ;\
1155 diff $(srcdir)/result/pattern/$$name result.$$name` ; \
1156 if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
1157 rm result.$$name ; \
1158 fi ; fi ; done ;)
1159
Daniel Veillardce1648b2005-01-04 15:10:22 +00001160ModuleTests: testModule$(EXEEXT) testdso.la
1161 @echo "## Module tests"
1162 @(./testModule$(EXEEXT))
1163
Daniel Veillard1a792412003-11-18 23:52:38 +00001164cleanup:
1165 -@(find . -name .\#\* -exec rm {} \;)
Daniel Richard G5706b6d2012-08-06 11:32:54 +08001166 -@(find . -name \*.gcda -o -name \*.gcno -exec rm -f {} \;)
1167 -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm -f {} \;)
Daniel Veillard1a792412003-11-18 23:52:38 +00001168
1169dist-hook: cleanup libxml2.spec
Daniel Veillard580ced82003-03-21 21:22:48 +00001170 -cp libxml2.spec $(distdir)
Patrick Monnerat917e3532014-03-04 17:36:54 +01001171 (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn --exclude .git win32 macos os400 vms VxWorks bakefile test result) | (cd $(distdir); tar xf -)
Michael Fulbright63dc42c1999-02-21 21:20:12 +00001172
Daniel Veillard0bff36d2004-08-31 09:37:03 +00001173dist-source: distdir
Daniel Veillarde4aaae22005-07-10 23:12:52 +00001174 $(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 +00001175
Daniel Veillard87b30462005-07-05 14:04:36 +00001176dist-test: distdir
Daniel Veillarde4aaae22005-07-10 23:12:52 +00001177 (mkdir -p $(distdir))
Daniel Veillardc943f702012-05-23 17:10:59 +08001178 (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn --exclude .git xstc/Tests) | (cd $(distdir); tar xf -)
Daniel Veillard1f33c4d2005-07-10 21:38:31 +00001179 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
1180 @(rm -rf $(distdir)/xstc/Test)
Daniel Veillard87b30462005-07-05 14:04:36 +00001181
Daniel Veillard8e199902001-01-25 18:54:39 +00001182cleantar:
Daniel Veillard55253e22002-02-18 14:32:39 +00001183 @(rm -f libxml*.tar.gz COPYING.LIB)
Daniel Veillard8e199902001-01-25 18:54:39 +00001184
Daniel Veillard1a792412003-11-18 23:52:38 +00001185rpm: cleanup cleantar
Daniel Veillarde4aaae22005-07-10 23:12:52 +00001186 @(unset CDPATH ; $(MAKE) dist-source dist && rpmbuild -ta $(distdir).tar.gz)
Owen Taylor3473f882001-02-23 17:55:21 +00001187
1188## We create xml2Conf.sh here and not from configure because we want
1189## to get the paths expanded correctly. Macros like srcdir are given
1190## the value NONE in configure if the user doesn't specify them (this
1191## is an autoconf feature, not a bug).
1192
Daniel Veillard06d25242004-02-25 13:01:42 +00001193xml2Conf.sh: xml2Conf.sh.in Makefile
1194## Use sed and then mv to avoid problems if the user interrupts.
1195 sed -e 's?\@XML_LIBDIR\@?$(XML_LIBDIR)?g' \
1196 -e 's?\@XML_INCLUDEDIR\@?$(XML_INCLUDEDIR)?g' \
1197 -e 's?\@VERSION\@?$(VERSION)?g' \
1198 -e 's?\@XML_LIBS\@?$(XML_LIBS)?g' \
1199 < $(srcdir)/xml2Conf.sh.in > xml2Conf.tmp \
1200 && mv xml2Conf.tmp xml2Conf.sh
1201
Daniel Richard G5706b6d2012-08-06 11:32:54 +08001202CLEANFILES = runxmlconf.log test.out xml2Conf.sh *.gcda *.gcno *.res
Daniel Veillard742a0bb2012-09-11 13:37:30 +08001203DISTCLEANFILES = COPYING missing.lst
Owen Taylor3473f882001-02-23 17:55:21 +00001204
1205confexecdir=$(libdir)
1206confexec_DATA = xml2Conf.sh
Daniel Veillard7a5e0dd2004-09-17 08:45:25 +00001207CVS_EXTRA_DIST=
Daniel Veillard580ced82003-03-21 21:22:48 +00001208EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml2.spec \
Daniel Veillard96f6fe92004-11-04 10:52:50 +00001209 libxml.m4 Copyright check-xml-test-suite.py gentest.py \
Daniel Veillard252004d2004-03-23 12:32:32 +00001210 check-relaxng-test-suite.py check-relaxng-test-suite2.py \
1211 check-xsddata-test-suite.py check-xinclude-test-suite.py \
Owen Taylor3473f882001-02-23 17:55:21 +00001212 example/Makefile.am example/gjobread.c example/gjobs.xml \
AEST 2003 Malcolm Tredinnick06431122003-09-30 02:36:08 +00001213 $(man_MANS) libxml-2.0.pc.in libxml-2.0-uninstalled.pc.in \
orzen0f84ee22016-02-09 17:55:40 +01001214 libxml2-config.cmake.in autogen.sh \
Bjorn Reese026d29f2002-01-19 15:40:18 +00001215 trionan.c trionan.h triostr.c triostr.h trio.c trio.h \
Daniel Veillardbca22f42012-07-11 16:48:47 +08001216 triop.h triodef.h libxml.h elfgcchack.h xzlib.h buf.h \
Daniel Veillard187e5292012-08-06 10:27:58 +08001217 enc.h save.h testThreadsWin32.c genUnicode.py TODO_SCHEMAS \
Daniel Veillarddab93ea2004-08-20 16:47:10 +00001218 dbgen.pl dbgenattr.pl regressions.py regressions.xml \
Vojtech Fried3e031b72012-08-24 16:52:44 +08001219 README.tests Makefile.tests libxml2.syms timsort.h \
Daniel Veillarddab93ea2004-08-20 16:47:10 +00001220 $(CVS_EXTRA_DIST)
Daniel Veillardf6bc7c22003-09-17 22:33:22 +00001221
Owen Taylor3473f882001-02-23 17:55:21 +00001222
1223pkgconfigdir = $(libdir)/pkgconfig
1224pkgconfig_DATA = libxml-2.0.pc
1225
Samuel Martinfa23ac12014-10-11 21:50:41 +02001226cmakedir = $(libdir)/cmake/libxml2
1227cmake_DATA = libxml2-config.cmake
1228
Daniel Veillard36065812002-01-24 15:02:46 +00001229#
William M. Brackf20fbf72004-06-25 05:49:08 +00001230# Install the tests program sources as examples
Daniel Veillard36065812002-01-24 15:02:46 +00001231#
Daniel Veillard366a9152002-10-23 20:43:53 +00001232BASE_DIR=$(datadir)/doc
Daniel Veillard36065812002-01-24 15:02:46 +00001233DOC_MODULE=libxml2-$(VERSION)
1234EXAMPLES_DIR=$(BASE_DIR)/$(DOC_MODULE)/examples
1235
1236install-data-local:
Daniel Richard G5706b6d2012-08-06 11:32:54 +08001237 $(MKDIR_P) $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)
1238 -$(INSTALL) -m 0644 $(srcdir)/Copyright $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)
1239 $(MKDIR_P) $(DESTDIR)$(EXAMPLES_DIR)
1240 -$(INSTALL) -m 0644 $(srcdir)/xmllint.c $(DESTDIR)$(EXAMPLES_DIR)
1241 -$(INSTALL) -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR)
1242 -$(INSTALL) -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR)
1243 -$(INSTALL) -m 0644 $(srcdir)/testXPath.c $(DESTDIR)$(EXAMPLES_DIR)
Daniel Veillardda3b29a2004-08-14 11:15:13 +00001244
Daniel Veillard9ebb6322008-01-11 07:19:24 +00001245uninstall-local:
Daniel Veillard2173b5c2009-08-24 14:23:32 +02001246 rm -f $(DESTDIR)$(EXAMPLES_DIR)/testXPath.c
1247 rm -f $(DESTDIR)$(EXAMPLES_DIR)/testHTML.c
1248 rm -f $(DESTDIR)$(EXAMPLES_DIR)/testSAX.c
1249 rm -f $(DESTDIR)$(EXAMPLES_DIR)/xmllint.c
Daniel Veillard9ebb6322008-01-11 07:19:24 +00001250 rm -rf $(DESTDIR)$(EXAMPLES_DIR)
Daniel Veillard2173b5c2009-08-24 14:23:32 +02001251 rm -f $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)/Copyright
Daniel Veillard9ebb6322008-01-11 07:19:24 +00001252 rm -rf $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)
1253
Daniel Veillardda3b29a2004-08-14 11:15:13 +00001254tst: tst.c
Daniel Veillard48f0f3f2012-05-08 10:59:41 +08001255 $(CC) $(CFLAGS) -Iinclude -o tst tst.c .libs/libxml2.a -lpthread -lm -lz -llzma
Daniel Veillard75e389d2005-07-29 22:02:24 +00001256
1257sparse: clean
1258 $(MAKE) CC=cgcc
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001259
1260#
1261# Coverage support, largely borrowed from libvirt
1262# Both binaries comes from the lcov package in Fedora
1263#
1264LCOV = /usr/bin/lcov
1265GENHTML = /usr/bin/genhtml
1266
1267cov: clean-cov
1268 if [ "`echo $(LDFLAGS) | grep coverage`" = "" ] ; then \
1269 echo not configured with coverage; exit 1 ; fi
1270 if [ ! -x $(LCOV) -o ! -x $(GENHTML) ] ; then \
1271 echo Need $(LCOV) and $(GENHTML) excecutables; exit 1 ; fi
1272 -@($(MAKE) check)
1273 -@(./runsuite$(EXEEXT))
1274 mkdir $(top_builddir)/coverage
1275 $(LCOV) -c -o $(top_builddir)/coverage/libxml2.info.tmp -d $(top_srcdir)
1276 $(LCOV) -r $(top_builddir)/coverage/libxml2.info.tmp -o $(top_builddir)/coverage/libxml2.info *usr*
1277 rm $(top_builddir)/coverage/libxml2.info.tmp
1278 $(GENHTML) -s -t "libxml2" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libxml2.info
1279 echo "Coverage report is in $(top_builddir)/coverage/index.html"
1280
1281clean-cov:
1282 rm -rf $(top_builddir)/coverage
1283