blob: 6d870545701ada739b08dc9f0cef3be40c2c239c [file] [log] [blame]
Daniel Veillard01791d51998-07-24 19:24:09 +00001## Process this file with automake to produce Makefile.in
Daniel Veillardc3e39442002-02-01 09:29:41 +00002#AUTOMAKE_ OPTIONS=no-dependencies
Daniel Veillard77044732001-06-29 21:31:07 +00003
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00004SUBDIRS = include . doc example python
Daniel Veillard19b858c1999-02-06 18:12:01 +00005
Daniel Veillardb8478642001-10-12 17:29:10 +00006INCLUDES = -I@srcdir@/include -I$(top_builddir)/include @THREAD_CFLAGS@ @Z_CFLAGS@
Daniel Veillard14fff061999-06-22 21:49:07 +00007
Daniel Veillardab7488e2001-10-17 11:30:37 +00008noinst_PROGRAMS=testSAX testHTML testXPath testURI testDocbook testThreads
Daniel Veillard27fb0751998-10-17 06:47:46 +00009
Daniel Veillard344cee72001-08-20 00:08:40 +000010bin_PROGRAMS = xmllint xmlcatalog
Daniel Veillard01791d51998-07-24 19:24:09 +000011
Owen Taylor3473f882001-02-23 17:55:21 +000012bin_SCRIPTS=xml2-config
13
14lib_LTLIBRARIES = libxml2.la
Daniel Veillard5eb9dea2001-09-07 09:38:02 +000015libxml2_la_LIBADD = @Z_LIBS@ $(ICONV_LIBS) -lm
Owen Taylor3473f882001-02-23 17:55:21 +000016
17libxml2_la_LDFLAGS = -version-info @LIBXML_VERSION_INFO@
18
Daniel Veillard7150a032001-05-02 16:41:11 +000019if WITH_TRIO_SOURCES
Daniel Veillard92ad2102001-03-27 12:47:33 +000020libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
21 parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \
22 valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \
Daniel Veillardeae522a2001-04-23 13:41:34 +000023 xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \
Bjorn Reese026d29f2002-01-19 15:40:18 +000024 catalog.c globals.c threads.c triostr.c trio.c
Daniel Veillard7150a032001-05-02 16:41:11 +000025
26else
27libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
28 parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \
29 valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \
Daniel Veillarda7374592001-05-10 14:17:55 +000030 xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \
Daniel Veillardd0463562001-10-13 09:15:48 +000031 catalog.c globals.c threads.c
Daniel Veillard7150a032001-05-02 16:41:11 +000032
33endif
Owen Taylor3473f882001-02-23 17:55:21 +000034
35DEPS = $(top_builddir)/libxml2.la
Daniel Veillardb8478642001-10-12 17:29:10 +000036LDADDS = $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) -lm
Owen Taylor3473f882001-02-23 17:55:21 +000037
Daniel Veillard52dcab32001-10-30 12:51:17 +000038man_MANS = xml2-config.1 libxml.4
Owen Taylor3473f882001-02-23 17:55:21 +000039
40m4datadir = $(datadir)/aclocal
41m4data_DATA = libxml.m4
42
43xmllint_SOURCES=xmllint.c
Daniel Veillard361d8452000-04-03 19:48:13 +000044xmllint_LDFLAGS =
45xmllint_DEPENDENCIES = $(DEPS)
Owen Taylor3473f882001-02-23 17:55:21 +000046xmllint_LDADD= @RDL_LIBS@ $(LDADDS)
Daniel Veillard01791d51998-07-24 19:24:09 +000047
Owen Taylor3473f882001-02-23 17:55:21 +000048testSAX_SOURCES=testSAX.c
Daniel Veillard011b63c1999-06-02 17:44:04 +000049testSAX_LDFLAGS =
50testSAX_DEPENDENCIES = $(DEPS)
Owen Taylor3473f882001-02-23 17:55:21 +000051testSAX_LDADD= $(LDADDS)
Daniel Veillard011b63c1999-06-02 17:44:04 +000052
Owen Taylor3473f882001-02-23 17:55:21 +000053testHTML_SOURCES=testHTML.c
Daniel Veillardbe70ff71999-07-05 16:50:46 +000054testHTML_LDFLAGS =
55testHTML_DEPENDENCIES = $(DEPS)
Owen Taylor3473f882001-02-23 17:55:21 +000056testHTML_LDADD= $(LDADDS)
Daniel Veillardbe70ff71999-07-05 16:50:46 +000057
Daniel Veillardeae522a2001-04-23 13:41:34 +000058testDocbook_SOURCES=testDocbook.c
59testDocbook_LDFLAGS =
60testDocbook_DEPENDENCIES = $(DEPS)
61testDocbook_LDADD= $(LDADDS)
62
Daniel Veillard344cee72001-08-20 00:08:40 +000063xmlcatalog_SOURCES=xmlcatalog.c
64xmlcatalog_LDFLAGS =
65xmlcatalog_DEPENDENCIES = $(DEPS)
Daniel Veillard03f848d2001-11-07 12:53:46 +000066xmlcatalog_LDADD= @RDL_LIBS@ $(LDADDS)
Daniel Veillarda7374592001-05-10 14:17:55 +000067
Owen Taylor3473f882001-02-23 17:55:21 +000068testXPath_SOURCES=testXPath.c
Daniel Veillard1566d3a1999-07-15 14:24:29 +000069testXPath_LDFLAGS =
70testXPath_DEPENDENCIES = $(DEPS)
Owen Taylor3473f882001-02-23 17:55:21 +000071testXPath_LDADD= $(LDADDS)
Daniel Veillard1566d3a1999-07-15 14:24:29 +000072
Daniel Veillardab7488e2001-10-17 11:30:37 +000073testThreads_SOURCES=testThreads.c
74testThreads_LDFLAGS =
75testThreads_DEPENDENCIES = $(DEPS)
76testThreads_LDADD= $(LDADDS)
77
Owen Taylor3473f882001-02-23 17:55:21 +000078testURI_SOURCES=testURI.c
Daniel Veillard361d8452000-04-03 19:48:13 +000079testURI_LDFLAGS =
80testURI_DEPENDENCIES = $(DEPS)
Owen Taylor3473f882001-02-23 17:55:21 +000081testURI_LDADD= $(LDADDS)
Daniel Veillard361d8452000-04-03 19:48:13 +000082
Raja R Harinatha86c23e1999-03-05 22:14:01 +000083check-local: tests
84
Daniel Veillardf09e7e32000-10-01 15:53:30 +000085testall : tests SVGtests SAXtests
Daniel Veillard011b63c1999-06-02 17:44:04 +000086
Daniel Veillardab7488e2001-10-17 11:30:37 +000087tests: XMLtests XMLenttests HTMLtests Validtests URItests XPathtests XPtrtests XIncludetests Scripttests Catatests @TEST_THREADS@
Daniel Veillardb05deb71999-08-10 19:04:08 +000088
Daniel Veillard82150d81999-07-07 07:32:15 +000089HTMLtests : testHTML
Daniel Veillard357c9602001-05-03 10:49:20 +000090 @(echo > .memdump)
Daniel Veillardb05deb71999-08-10 19:04:08 +000091 @echo "##"
92 @echo "## HTML regression tests"
93 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +000094 -@(for i in $(srcdir)/test/HTML/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +000095 name=`basename $$i`; \
Daniel Veillard82150d81999-07-07 07:32:15 +000096 if [ ! -d $$i ] ; then \
Daniel Veillardb05deb71999-08-10 19:04:08 +000097 if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
98 echo New test file $$name ; \
Daniel Veillard167bd532001-01-06 21:09:34 +000099 $(top_builddir)/testHTML $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \
Daniel Veillard82150d81999-07-07 07:32:15 +0000100 else \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000101 echo Testing $$name ; \
Daniel Veillard167bd532001-01-06 21:09:34 +0000102 $(top_builddir)/testHTML $$i > result.$$name 2> error.$$name ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000103 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000104 diff $(srcdir)/result/HTML/$$name result.$$name ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000105 diff -b $(srcdir)/result/HTML/$$name.err error.$$name ; \
Daniel Veillard167bd532001-01-06 21:09:34 +0000106 $(top_builddir)/testHTML result.$$name > result2.$$name 2>error.$$name ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000107 diff result.$$name result2.$$name ; \
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000108 rm result.$$name result2.$$name error.$$name ; \
Daniel Veillard82150d81999-07-07 07:32:15 +0000109 fi ; fi ; done)
Daniel Veillard87b95392000-08-12 21:12:04 +0000110 @echo "##"
111 @echo "## Push HTML regression tests"
112 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000113 -@(for i in $(srcdir)/test/HTML/* ; do \
Daniel Veillard87b95392000-08-12 21:12:04 +0000114 name=`basename $$i`; \
115 if [ ! -d $$i ] ; then \
116 if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
117 echo New test file $$name ; \
Daniel Veillard167bd532001-01-06 21:09:34 +0000118 $(top_builddir)/testHTML $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000119 else \
120 echo Testing $$name ; \
Daniel Veillard167bd532001-01-06 21:09:34 +0000121 $(top_builddir)/testHTML --push $$i > result.$$name 2> error.$$name ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000122 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
123 diff $(srcdir)/result/HTML/$$name result.$$name ; \
124 cut -b 1-15 $(srcdir)/result/HTML/$$name.err > errorcut.$$name; \
125 cut -b 1-15 error.$$name > errorcut2.$$name; \
126 diff -b errorcut.$$name errorcut2.$$name ; \
Daniel Veillard167bd532001-01-06 21:09:34 +0000127 $(top_builddir)/testHTML --push result.$$name > result2.$$name 2>error.$$name ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000128 diff result.$$name result2.$$name ; \
129 rm result.$$name result2.$$name error.$$name errorcut.$$name errorcut2.$$name ; \
130 fi ; fi ; done)
131 @echo "##"
132 @echo "## HTML SAX regression tests"
133 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000134 -@(for i in $(srcdir)/test/HTML/* ; do \
Daniel Veillard87b95392000-08-12 21:12:04 +0000135 name=`basename $$i`; \
136 if [ ! -d $$i ] ; then \
137 if [ ! -f $(srcdir)/result/HTML/$$name.sax ] ; then \
138 echo New test file $$name ; \
Daniel Veillard167bd532001-01-06 21:09:34 +0000139 $(top_builddir)/testHTML --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000140 else \
141 echo Testing $$name ; \
Daniel Veillard167bd532001-01-06 21:09:34 +0000142 $(top_builddir)/testHTML --sax $$i > result.$$name.sax ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000143 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
144 diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax ; \
145 rm result.$$name.sax ; \
146 fi ; fi ; done)
147 @echo "##"
148 @echo "## Push HTML SAX regression tests"
149 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000150 -@(for i in $(srcdir)/test/HTML/* ; do \
Daniel Veillard87b95392000-08-12 21:12:04 +0000151 name=`basename $$i`; \
152 if [ ! -d $$i ] ; then \
153 if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
154 echo New test file $$name ; \
Daniel Veillard167bd532001-01-06 21:09:34 +0000155 $(top_builddir)/testHTML --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000156 else \
157 echo Testing $$name ; \
Daniel Veillard167bd532001-01-06 21:09:34 +0000158 $(top_builddir)/testHTML --push --sax $$i > result.$$name.sax ; \
Daniel Veillard87b95392000-08-12 21:12:04 +0000159 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
160 diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax ; \
161 rm result.$$name.sax ; \
162 fi ; fi ; done)
163
Daniel Veillard82150d81999-07-07 07:32:15 +0000164
Daniel Veillard361d8452000-04-03 19:48:13 +0000165XMLtests : xmllint
Daniel Veillard357c9602001-05-03 10:49:20 +0000166 @(echo > .memdump)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000167 @echo "##"
168 @echo "## XML regression tests"
169 @echo "##"
Daniel Veillardde57c612001-04-23 09:13:36 +0000170 @echo "## You should see one warning on entity 'title.xml' for ent2"
171 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000172 -@(for i in $(srcdir)/test/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000173 name=`basename $$i`; \
Daniel Veillard01791d51998-07-24 19:24:09 +0000174 if [ ! -d $$i ] ; then \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000175 if [ ! -f $(srcdir)/result/$$name ] ; then \
176 echo New test file $$name ; \
Daniel Veillard361d8452000-04-03 19:48:13 +0000177 $(top_builddir)/xmllint $$i > $(srcdir)/result/$$name ; \
Daniel Veillard01791d51998-07-24 19:24:09 +0000178 else \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000179 echo Testing $$name ; \
Daniel Veillard361d8452000-04-03 19:48:13 +0000180 $(top_builddir)/xmllint $$i > result.$$name ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000181 diff $(srcdir)/result/$$name result.$$name ; \
Daniel Veillard361d8452000-04-03 19:48:13 +0000182 $(top_builddir)/xmllint result.$$name > result2.$$name ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000183 diff result.$$name result2.$$name ; \
184 rm result.$$name result2.$$name ; \
Daniel Veillard01791d51998-07-24 19:24:09 +0000185 fi ; fi ; done)
Daniel Veillard3e5bb8e2001-06-27 16:34:34 +0000186 @(echo > .memdump)
187 @echo "##"
188 @echo "## XML push regression tests"
189 @echo "##"
190 @echo "## You should see one warning on entity 'title.xml' for ent2"
191 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000192 -@(for i in $(srcdir)/test/* ; do \
Daniel Veillard3e5bb8e2001-06-27 16:34:34 +0000193 name=`basename $$i`; \
194 if [ ! -d $$i ] ; then \
195 if [ ! -f $(srcdir)/result/$$name ] ; then \
196 echo New test file $$name ; \
197 $(top_builddir)/xmllint --push $$i > $(srcdir)/result/$$name ; \
198 else \
199 echo Testing $$name ; \
200 $(top_builddir)/xmllint --push $$i > result.$$name ; \
201 diff $(srcdir)/result/$$name result.$$name ; \
202 $(top_builddir)/xmllint --push result.$$name > result2.$$name ; \
203 diff result.$$name result2.$$name ; \
204 rm result.$$name result2.$$name ; \
205 fi ; fi ; done)
Daniel Veillarda6d8eb62000-12-27 10:46:47 +0000206 @echo "##"
207 @echo "## XML regression tests on memory"
208 @echo "##"
Daniel Veillardde57c612001-04-23 09:13:36 +0000209 @echo "## You should see two warnings on entity 'title.xml' for ent2"
210 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000211 -@(for i in $(srcdir)/test/* ; do \
Daniel Veillarda6d8eb62000-12-27 10:46:47 +0000212 name=`basename $$i`; \
213 if [ ! -d $$i ] ; then \
214 if [ ! -f $(srcdir)/result/$$name ] ; then \
215 echo New test file $$name ; \
216 $(top_builddir)/xmllint --memory $$i > $(srcdir)/result/$$name ; \
217 else \
218 echo Testing $$name ; \
219 $(top_builddir)/xmllint --memory $$i > result.$$name ; \
220 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
221 diff $(srcdir)/result/$$name result.$$name ; \
222 $(top_builddir)/xmllint --memory result.$$name > result2.$$name ; \
223 diff result.$$name result2.$$name ; \
224 rm result.$$name result2.$$name ; \
225 fi ; fi ; done)
Daniel Veillard01791d51998-07-24 19:24:09 +0000226
Daniel Veillard89cad532001-10-22 09:46:13 +0000227Docbtests : xmllint
228 @(echo > .memdump)
229 @echo "##"
230 @echo "## SGML DocBook regression tests"
231 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000232 -@(for i in $(srcdir)/test/DocBook/*.sgm ; do \
Daniel Veillard89cad532001-10-22 09:46:13 +0000233 name=`basename $$i .sgm`; \
234 if [ ! -d $$i ] ; then \
235 if [ ! -f $(srcdir)/result/DocBook/$$name.xml ] ; then \
236 echo New test file $$name ; \
237 $(top_builddir)/xmllint --sgml $$i > $(srcdir)/result/DocBook/$$name.xml ; \
238 $(top_builddir)/xmllint --valid --noout $(srcdir)/result/DocBook/$$name.xml ; \
239 else \
240 echo Testing $$name ; \
241 $(top_builddir)/xmllint --sgml $$i > result.$$name ; \
242 diff $(srcdir)/result/DocBook/$$name.xml result.$$name ; \
243 $(top_builddir)/xmllint --valid --noout result.$$name ; \
244 rm result.$$name ; \
245 fi ; fi ; done)
246
Daniel Veillard361d8452000-04-03 19:48:13 +0000247XMLenttests : xmllint
Daniel Veillard357c9602001-05-03 10:49:20 +0000248 @(echo > .memdump)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000249 @echo "##"
250 @echo "## XML entity subst regression tests"
251 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000252 -@(for i in $(srcdir)/test/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000253 name=`basename $$i`; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000254 if [ ! -d $$i ] ; then \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000255 if [ ! -f $(srcdir)/result/noent/$$name ] ; then \
256 echo New test file $$name ; \
Daniel Veillard361d8452000-04-03 19:48:13 +0000257 $(top_builddir)/xmllint --noent $$i > $(srcdir)/result/noent/$$name ; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000258 else \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000259 echo Testing $$name ; \
Daniel Veillard361d8452000-04-03 19:48:13 +0000260 $(top_builddir)/xmllint --noent $$i > result.$$name ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000261 diff $(srcdir)/result/noent/$$name result.$$name ; \
Daniel Veillard361d8452000-04-03 19:48:13 +0000262 $(top_builddir)/xmllint --noent result.$$name > result2.$$name ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000263 diff result.$$name result2.$$name ; \
264 rm result.$$name result2.$$name ; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000265 fi ; fi ; done)
266
Daniel Veillard98a79162000-09-04 11:15:39 +0000267URItests : testURI
Daniel Veillard357c9602001-05-03 10:49:20 +0000268 @(echo > .memdump)
Daniel Veillard98a79162000-09-04 11:15:39 +0000269 @echo "##"
270 @echo "## URI module regression tests"
271 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000272 -@(for i in $(srcdir)/test/URI/*.data ; do \
Daniel Veillard98a79162000-09-04 11:15:39 +0000273 name=`basename $$i`; \
274 if [ ! -d $$i ] ; then \
275 if [ ! -f $(srcdir)/result/URI/$$name ] ; then \
276 echo New test file $$name ; \
Daniel Veillard90e11312000-09-05 10:42:32 +0000277 $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i > $(srcdir)/result/URI/$$name ; \
Daniel Veillard98a79162000-09-04 11:15:39 +0000278 else \
279 echo Testing $$name ; \
Daniel Veillard90e11312000-09-05 10:42:32 +0000280 $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i > result.$$name ; \
Daniel Veillard98a79162000-09-04 11:15:39 +0000281 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
282 diff $(srcdir)/result/URI/$$name result.$$name ; \
283 rm result.$$name ; \
284 fi ; fi ; done)
Daniel Veillard36065812002-01-24 15:02:46 +0000285 -@(for i in $(srcdir)/test/URI/*.uri ; do \
Daniel Veillardb6e7fdb2001-02-02 17:07:32 +0000286 name=`basename $$i`; \
287 if [ ! -d $$i ] ; then \
288 if [ ! -f $(srcdir)/result/URI/$$name ] ; then \
289 echo New test file $$name ; \
290 $(top_builddir)/testURI < $$i > $(srcdir)/result/URI/$$name ; \
291 else \
292 echo Testing $$name ; \
293 $(top_builddir)/testURI < $$i > result.$$name ; \
294 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
295 diff $(srcdir)/result/URI/$$name result.$$name ; \
296 rm result.$$name ; \
297 fi ; fi ; done)
Daniel Veillard98a79162000-09-04 11:15:39 +0000298
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000299XPathtests : testXPath
Daniel Veillard357c9602001-05-03 10:49:20 +0000300 @(echo > .memdump)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000301 @echo "##"
302 @echo "## XPath regression tests"
303 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000304 -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \
Daniel Veillard017b1082001-06-21 11:20:21 +0000305 then echo Skipping debug not compiled in ; exit 0 ; fi ; \
306 for i in $(srcdir)/test/XPath/expr/* ; do \
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000307 name=`basename $$i`; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000308 if [ ! -d $$i ] ; then \
309 if [ ! -f $(srcdir)/result/XPath/expr/$$name ] ; then \
310 echo New test file $$name ; \
CEST 1999 Timur Bakeyev6db3cb01999-09-04 20:25:14 +0000311 $(top_builddir)/testXPath -f --expr $$i > $(srcdir)/result/XPath/expr/$$name ; \
Daniel Veillard9e7160d2001-03-18 23:17:47 +0000312 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000313 else \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000314 echo Testing $$name ; \
CEST 1999 Timur Bakeyev6db3cb01999-09-04 20:25:14 +0000315 $(top_builddir)/testXPath -f --expr $$i > result.$$name ; \
Daniel Veillard9e7160d2001-03-18 23:17:47 +0000316 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000317 diff $(srcdir)/result/XPath/expr/$$name result.$$name ; \
318 rm result.$$name ; \
Daniel Veillard017b1082001-06-21 11:20:21 +0000319 fi ; fi ; done ; \
320 for i in $(srcdir)/test/XPath/docs/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000321 if [ ! -d $$i ] ; then \
322 doc=`basename $$i`; \
323 for j in $(srcdir)/test/XPath/tests/$$doc* ; do \
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000324 if [ ! -f $$j ] ; then continue ; fi ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000325 name=`basename $$j`; \
326 if [ ! -d $$j ] ; then \
327 if [ ! -f $(srcdir)/result/XPath/tests/$$name ] ; then \
328 echo New test file $$name ; \
CEST 1999 Timur Bakeyev6db3cb01999-09-04 20:25:14 +0000329 $(top_builddir)/testXPath -f -i $$i $$j > $(srcdir)/result/XPath/tests/$$name ; \
Daniel Veillard9e7160d2001-03-18 23:17:47 +0000330 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000331 else \
332 echo Testing $$name ; \
CEST 1999 Timur Bakeyev6db3cb01999-09-04 20:25:14 +0000333 $(top_builddir)/testXPath -f -i $$i $$j > result.$$name ; \
Daniel Veillard9e7160d2001-03-18 23:17:47 +0000334 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000335 diff $(srcdir)/result/XPath/tests/$$name result.$$name ; \
336 rm result.$$name ; \
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000337 fi ; fi ; done ; fi ; done)
338
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000339XPtrtests : testXPath
Daniel Veillard357c9602001-05-03 10:49:20 +0000340 @(echo > .memdump)
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000341 @echo "##"
342 @echo "## XPointer regression tests"
343 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000344 -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \
Daniel Veillard017b1082001-06-21 11:20:21 +0000345 then echo Skipping debug not compiled in ; exit 0 ; fi ; \
346 for i in $(srcdir)/test/XPath/docs/* ; do \
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000347 if [ ! -d $$i ] ; then \
348 doc=`basename $$i`; \
349 for j in $(srcdir)/test/XPath/xptr/$$doc* ; do \
350 if [ ! -f $$j ] ; then continue ; fi ; \
351 name=`basename $$j`; \
352 if [ ! -d $$j ] ; then \
353 if [ ! -f $(srcdir)/result/XPath/xptr/$$name ] ; then \
354 echo New test file $$name ; \
355 ./testXPath -xptr -f -i $$i $$j > $(srcdir)/result/XPath/xptr/$$name ; \
356 else \
357 echo Testing $$name ; \
358 ./testXPath -xptr -f -i $$i $$j > result.$$name ; \
359 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
360 diff $(srcdir)/result/XPath/xptr/$$name result.$$name ; \
361 rm result.$$name ; \
362 fi ; fi ; done ; fi ; done)
363
Daniel Veillardbf432752000-11-12 15:56:56 +0000364XIncludetests : xmllint
Daniel Veillard357c9602001-05-03 10:49:20 +0000365 @(echo > .memdump)
Daniel Veillardbf432752000-11-12 15:56:56 +0000366 @echo "##"
367 @echo "## XInclude regression tests"
368 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000369 -@(for i in $(srcdir)/test/XInclude/docs/* ; do \
Daniel Veillardbf432752000-11-12 15:56:56 +0000370 name=`basename $$i`; \
371 if [ ! -d $$i ] ; then \
372 if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \
373 echo New test file $$name ; \
374 $(top_builddir)/xmllint --xinclude $$i > $(srcdir)/result/XInclude/$$name ; \
375 else \
376 echo Testing $$name ; \
377 $(top_builddir)/xmllint --xinclude $$i > result.$$name ; \
378 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
379 diff $(srcdir)/result/XInclude/$$name result.$$name ; \
380 rm result.$$name ; \
381 fi ; fi ; done)
382
Daniel Veillardb8c9be92001-07-09 16:01:19 +0000383Scripttests : xmllint
384 @(echo > .memdump)
385 @echo "##"
386 @echo "## Scripts regression tests"
387 @echo "## Some of the base computations may be different if srcdir != ."
388 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000389 -@(for i in $(srcdir)/test/scripts/*.script ; do \
Daniel Veillardb8c9be92001-07-09 16:01:19 +0000390 name=`basename $$i .script`; \
391 xml=$(srcdir)/test/scripts/`basename $$i .script`.xml; \
392 if [ -f $$xml ] ; then \
393 if [ ! -f $(srcdir)/result/scripts/$$name ] ; then \
394 echo New test file $$name ; \
395 $(top_builddir)/xmllint --shell $$xml < $$i > $(srcdir)/result/scripts/$$name ; \
396 else \
397 echo Testing $$name ; \
398 $(top_builddir)/xmllint --shell $$xml < $$i > result.$$name ; \
399 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
400 diff $(srcdir)/result/scripts/$$name result.$$name ; \
401 rm result.$$name ; \
402 fi ; fi ; done)
403
Daniel Veillardcda96922001-08-21 10:56:31 +0000404Catatests : xmlcatalog
405 @(echo > .memdump)
406 @echo "##"
407 @echo "## Catalog regression tests"
408 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000409 -@(for i in $(srcdir)/test/catalogs/*.script ; do \
Daniel Veillardcda96922001-08-21 10:56:31 +0000410 name=`basename $$i .script`; \
411 xml=$(srcdir)/test/catalogs/`basename $$i .script`.xml; \
412 if [ -f $$xml ] ; then \
413 if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
414 echo New test file $$name ; \
415 $(top_builddir)/xmlcatalog --shell $$xml < $$i > $(srcdir)/result/catalogs/$$name ; \
416 else \
417 echo Testing $$name ; \
418 $(top_builddir)/xmlcatalog --shell $$xml < $$i > result.$$name ; \
419 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
420 diff $(srcdir)/result/catalogs/$$name result.$$name ; \
421 rm result.$$name ; \
422 fi ; fi ; done)
Daniel Veillard36065812002-01-24 15:02:46 +0000423 -@(for i in $(srcdir)/test/catalogs/*.script ; do \
Daniel Veillardc853b322001-11-06 15:24:37 +0000424 name=`basename $$i .script`; \
425 sgml=$(srcdir)/test/catalogs/`basename $$i .script`.sgml; \
426 if [ -f $$sgml ] ; then \
427 if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
428 echo New test file $$name ; \
429 $(top_builddir)/xmlcatalog --shell $$sgml < $$i > $(srcdir)/result/catalogs/$$name ; \
430 else \
431 echo Testing $$name ; \
432 $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \
433 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
434 diff $(srcdir)/result/catalogs/$$name result.$$name ; \
435 rm result.$$name ; \
436 fi ; fi ; done)
437 @echo "Add and del operations on XML Catalogs"
Daniel Veillard36065812002-01-24 15:02:46 +0000438 -@($(top_builddir)/xmlcatalog --create --noout result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000439 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard8e3943c2001-11-12 21:35:44 +0000440 $(top_builddir)/xmlcatalog --noout --add public Pubid sysid result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000441 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard8e3943c2001-11-12 21:35:44 +0000442 $(top_builddir)/xmlcatalog --noout --add public Pubid2 sysid2 result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000443 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard8e3943c2001-11-12 21:35:44 +0000444 $(top_builddir)/xmlcatalog --noout --add public Pubid3 sysid3 result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000445 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
446 diff result/catalogs/mycatalog.full result/catalogs/mycatalog; \
447 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard8e3943c2001-11-12 21:35:44 +0000448 $(top_builddir)/xmlcatalog --noout --del sysid result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000449 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard8e3943c2001-11-12 21:35:44 +0000450 $(top_builddir)/xmlcatalog --noout --del sysid3 result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000451 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
Daniel Veillard8e3943c2001-11-12 21:35:44 +0000452 $(top_builddir)/xmlcatalog --noout --del sysid2 result/catalogs/mycatalog; \
Daniel Veillardc853b322001-11-06 15:24:37 +0000453 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
454 diff result/catalogs/mycatalog.empty result/catalogs/mycatalog; \
455 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
456 rm -f result/catalogs/mycatalog)
Daniel Veillardcda96922001-08-21 10:56:31 +0000457
Daniel Veillard361d8452000-04-03 19:48:13 +0000458SVGtests : xmllint
Daniel Veillardb05deb71999-08-10 19:04:08 +0000459 @echo "##"
460 @echo "## SVG parsing regression tests"
461 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000462 -@(for i in $(srcdir)/test/SVG/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000463 name=`basename $$i`; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000464 if [ ! -d $$i ] ; then \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000465 if [ ! -f $(srcdir)/result/SVG/$$name ] ; then \
466 echo New test file $$name ; \
Daniel Veillard361d8452000-04-03 19:48:13 +0000467 $(top_builddir)/xmllint $$i > $(srcdir)/result/SVG/$$name ; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000468 else \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000469 echo Testing $$name ; \
Daniel Veillard361d8452000-04-03 19:48:13 +0000470 $(top_builddir)/xmllint $$i > result.$$name ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000471 diff $(srcdir)/result/SVG/$$name result.$$name ; \
Daniel Veillard361d8452000-04-03 19:48:13 +0000472 $(top_builddir)/xmllint result.$$name > result2.$$name ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000473 diff result.$$name result2.$$name ; \
474 rm result.$$name result2.$$name ; \
Daniel Veillard011b63c1999-06-02 17:44:04 +0000475 fi ; fi ; done)
476
Daniel Veillardab7488e2001-10-17 11:30:37 +0000477Threadtests : testThreads
478 @echo "##"
479 @echo "## Threaded regression tests"
480 @echo "##"
Daniel Veillard8bdb91d2001-10-31 17:52:43 +0000481 $(top_builddir)/testThreads
Daniel Veillardab7488e2001-10-17 11:30:37 +0000482
Daniel Veillardb05deb71999-08-10 19:04:08 +0000483SAXtests : testSAX
Daniel Veillard357c9602001-05-03 10:49:20 +0000484 @(echo > .memdump)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000485 @echo "##"
486 @echo "## SAX callbacks regression tests"
487 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000488 -@(for i in $(srcdir)/test/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000489 name=`basename $$i`; \
490 if [ ! -d $$i ] ; then \
491 if [ ! -f $(srcdir)/SAXresult/$$name ] ; then \
492 echo New test file $$name ; \
CEST 1999 Timur Bakeyev6db3cb01999-09-04 20:25:14 +0000493 $(top_builddir)/testSAX $$i > $(srcdir)/SAXresult/$$name ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000494 else \
495 echo Testing $$name ; \
CEST 1999 Timur Bakeyev6db3cb01999-09-04 20:25:14 +0000496 $(top_builddir)/testSAX $$i > result.$$name ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000497 diff $(srcdir)/SAXresult/$$name result.$$name ; \
498 rm result.$$name ; \
499 fi ; fi ; done)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +0000500
Arturo Espinosa15fe6e71998-09-07 17:27:57 +0000501
Daniel Veillard361d8452000-04-03 19:48:13 +0000502Validtests : xmllint
Daniel Veillard357c9602001-05-03 10:49:20 +0000503 @(echo > .memdump)
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000504 @echo "##"
505 @echo "## Valid documents regression tests"
506 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000507 -@(for i in $(srcdir)/test/VCM/* ; do \
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000508 name=`basename $$i`; \
509 if [ ! -d $$i ] ; then \
510 echo Testing $$name ; \
Daniel Veillard4de4d3b2001-05-07 20:50:47 +0000511 $(top_builddir)/xmllint --valid --noout --nowarning $$i ; \
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000512 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
513 fi ; done ; exit 0)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000514 @echo "##"
515 @echo "## Validity checking regression tests"
516 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000517 -@(for i in $(srcdir)/test/VC/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000518 name=`basename $$i`; \
519 if [ ! -d $$i ] ; then \
520 if [ ! -f $(srcdir)/result/VC/$$name ] ; then \
521 echo New test file $$name ; \
Daniel Veillard361d8452000-04-03 19:48:13 +0000522 $(top_builddir)/xmllint --noout --valid $$i 2> $(srcdir)/result/VC/$$name ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000523 else \
524 echo Testing $$name ; \
Daniel Veillard361d8452000-04-03 19:48:13 +0000525 $(top_builddir)/xmllint --noout --valid $$i 2> result.$$name ; \
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000526 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000527 diff $(srcdir)/result/VC/$$name result.$$name ; \
528 rm result.$$name ; \
529 fi ; fi ; done)
530 @echo "##"
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000531 @echo "## General documents valid regression tests"
Daniel Veillardb05deb71999-08-10 19:04:08 +0000532 @echo "##"
Daniel Veillard36065812002-01-24 15:02:46 +0000533 -@(for i in $(srcdir)/test/valid/* ; do \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000534 name=`basename $$i`; \
535 if [ ! -d $$i ] ; then \
536 if [ ! -f $(srcdir)/result/valid/$$name ] ; then \
537 echo New test file $$name ; \
Daniel Veillard361d8452000-04-03 19:48:13 +0000538 $(top_builddir)/xmllint --valid $$i > $(srcdir)/result/valid/$$name 2>$(srcdir)/result/valid/$$name.err ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000539 else \
540 echo Testing $$name ; \
Daniel Veillard361d8452000-04-03 19:48:13 +0000541 $(top_builddir)/xmllint --valid $$i > result.$$name 2>error.$$name ; \
Daniel Veillarddab4cb32001-04-20 13:03:48 +0000542 grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
Daniel Veillardb05deb71999-08-10 19:04:08 +0000543 diff $(srcdir)/result/valid/$$name result.$$name ; \
Daniel Veillard35008381999-10-25 13:15:52 +0000544 diff $(srcdir)/result/valid/$$name.err error.$$name ; \
545 rm result.$$name error.$$name ; \
Daniel Veillardb05deb71999-08-10 19:04:08 +0000546 fi ; fi ; done)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +0000547
Daniel Veillard1a123612001-09-19 08:06:23 +0000548dist-hook: libxml.spec
549 -cp libxml.spec $(distdir)
Daniel Veillardd3b08822001-12-05 12:03:33 +0000550 (cd $(srcdir) ; tar -cf - --exclude CVS win32 macos vms test result SAXresult ) | (cd $(distdir); tar xf -)
Michael Fulbright63dc42c1999-02-21 21:20:12 +0000551
Daniel Veillard8e199902001-01-25 18:54:39 +0000552cleantar:
553 @(rm -f libxslt*.tar.gz)
554
Daniel Veillard314cfa02002-01-14 17:58:01 +0000555rpm: cleantar dist
Daniel Veillardc2df4cd2000-10-12 23:15:24 +0000556 rpm -ta $(distdir).tar.gz
Owen Taylor3473f882001-02-23 17:55:21 +0000557
558## We create xml2Conf.sh here and not from configure because we want
559## to get the paths expanded correctly. Macros like srcdir are given
560## the value NONE in configure if the user doesn't specify them (this
561## is an autoconf feature, not a bug).
562
Owen Taylor3473f882001-02-23 17:55:21 +0000563CLEANFILES=xml2Conf.sh
564
565confexecdir=$(libdir)
566confexec_DATA = xml2Conf.sh
Daniel Veillard3739b982001-06-19 12:51:30 +0000567EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml.spec \
568 libxml.m4 \
Owen Taylor3473f882001-02-23 17:55:21 +0000569 example/Makefile.am example/gjobread.c example/gjobs.xml \
Daniel Veillard07385fd2001-06-23 21:55:48 +0000570 $(man_MANS) libxml-2.0.pc.in \
Bjorn Reese026d29f2002-01-19 15:40:18 +0000571 trionan.c trionan.h triostr.c triostr.h trio.c trio.h \
Daniel Veillarddb0eb8d2002-01-13 13:35:00 +0000572 triop.h triodef.h libxml.h \
573 testThreadsWin32.c
Owen Taylor3473f882001-02-23 17:55:21 +0000574
575pkgconfigdir = $(libdir)/pkgconfig
576pkgconfig_DATA = libxml-2.0.pc
577
Daniel Veillard36065812002-01-24 15:02:46 +0000578#
579# Instll the tests program sources as examples
580#
581BASE_DIR=@HTML_DIR@
582DOC_MODULE=libxml2-$(VERSION)
583EXAMPLES_DIR=$(BASE_DIR)/$(DOC_MODULE)/examples
584
585install-data-local:
586 $(mkinstalldirs) $(DESTDIR)$(EXAMPLES_DIR)
587 -@INSTALL@ -m 0644 $(srcdir)/xmllint.c $(DESTDIR)$(EXAMPLES_DIR)
588 -@INSTALL@ -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR)
589 -@INSTALL@ -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR)
590 -@INSTALL@ -m 0644 $(srcdir)/testXPath.c $(DESTDIR)$(EXAMPLES_DIR)