Makefile.am 49.1 KB
Newer Older
1
## Process this file with automake to produce Makefile.in
2

3
SUBDIRS = include . doc example xstc @PYTHON_SUBDIR@
Daniel Veillard's avatar
Daniel Veillard committed
4

5
DIST_SUBDIRS = include . doc example python xstc
6

7
INCLUDES = -I$(top_builddir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@ 
8

9
noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \
10
                testThreads testC14N testAutomata testRegexp \
11
                testReader testapi testModule
12

13
bin_PROGRAMS = xmllint xmlcatalog
14

15
16
17
bin_SCRIPTS=xml2-config

lib_LTLIBRARIES = libxml2.la
18
libxml2_la_LIBADD = @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) @M_LIBS@ @WIN32_EXTRA_LIBADD@
19

20
libxml2_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ -version-info @LIBXML_VERSION_INFO@ @MODULE_PLATFORM_LIBS@
21

22
if WITH_TRIO_SOURCES
23
24
25
libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c  \
		parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c  \
		valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c  \
26
		xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \
27
		catalog.c globals.c threads.c c14n.c xmlstring.c \
28
		xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
29
		triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c \
30
		xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c xmlmodule.c
31
32
33
34
else
libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c  \
		parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c  \
		valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c  \
35
		xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \
36
		catalog.c globals.c threads.c c14n.c xmlstring.c \
37
		xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
38
		xmlreader.c relaxng.c dict.c SAX2.c \
39
40
		xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \
		xmlmodule.c
41
endif
42
43

DEPS = $(top_builddir)/libxml2.la
44
LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) @M_LIBS@ @WIN32_EXTRA_LIBADD@
45

46

47
man_MANS = xml2-config.1 libxml.3
48
49
50
51
52

m4datadir = $(datadir)/aclocal
m4data_DATA = libxml.m4

xmllint_SOURCES=xmllint.c
53
54
xmllint_LDFLAGS = 
xmllint_DEPENDENCIES = $(DEPS)
55
xmllint_LDADD=  @RDL_LIBS@ $(LDADDS)
56

57
testSAX_SOURCES=testSAX.c
58
59
testSAX_LDFLAGS = 
testSAX_DEPENDENCIES = $(DEPS)
60
testSAX_LDADD= $(LDADDS)
61

62
testHTML_SOURCES=testHTML.c
63
64
testHTML_LDFLAGS = 
testHTML_DEPENDENCIES = $(DEPS)
65
testHTML_LDADD= $(LDADDS)
66

67
68
69
xmlcatalog_SOURCES=xmlcatalog.c
xmlcatalog_LDFLAGS = 
xmlcatalog_DEPENDENCIES = $(DEPS)
70
xmlcatalog_LDADD= @RDL_LIBS@ $(LDADDS)
71

72
testXPath_SOURCES=testXPath.c
73
74
testXPath_LDFLAGS = 
testXPath_DEPENDENCIES = $(DEPS)
75
testXPath_LDADD= $(LDADDS)
76

77
78
79
80
81
testC14N_SOURCES=testC14N.c
testC14N_LDFLAGS = 
testC14N_DEPENDENCIES = $(DEPS)
testC14N_LDADD= $(LDADDS)

82
testThreads_SOURCES=testThreads@THREADS_W32@.c
83
84
85
86
testThreads_LDFLAGS = 
testThreads_DEPENDENCIES = $(DEPS)
testThreads_LDADD= $(LDADDS)

87
testURI_SOURCES=testURI.c
88
89
testURI_LDFLAGS = 
testURI_DEPENDENCIES = $(DEPS)
90
testURI_LDADD= $(LDADDS)
91

92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
testRegexp_SOURCES=testRegexp.c
testRegexp_LDFLAGS = 
testRegexp_DEPENDENCIES = $(DEPS)
testRegexp_LDADD= $(LDADDS)

testAutomata_SOURCES=testAutomata.c
testAutomata_LDFLAGS = 
testAutomata_DEPENDENCIES = $(DEPS)
testAutomata_LDADD= $(LDADDS)

testSchemas_SOURCES=testSchemas.c
testSchemas_LDFLAGS = 
testSchemas_DEPENDENCIES = $(DEPS)
testSchemas_LDADD= $(LDADDS)

107
108
109
110
111
testRelax_SOURCES=testRelax.c
testRelax_LDFLAGS = 
testRelax_DEPENDENCIES = $(DEPS)
testRelax_LDADD= $(LDADDS)

112
113
114
115
116
testReader_SOURCES=testReader.c
testReader_LDFLAGS = 
testReader_DEPENDENCIES = $(DEPS)
testReader_LDADD= $(LDADDS)

117
118
119
120
121
122
123
124
125
testModule_SOURCES=testModule.c
testModule_LDFLAGS = 
testModule_DEPENDENCIES = $(DEPS)
testModule_LDADD= $(LDADDS)

noinst_LTLIBRARIES = testdso.la
testdso_la_SOURCES = testdso.c
testdso_la_LDFLAGS = -module -rpath $(libdir)

126
127
128
129
130
131
132
133
# that one forces the rebuild when "make rebuild" is run on doc/
rebuild_testapi:
	-@(if [ "$(PYTHON)" != "" ] ; then \
	    $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi )

# that one is just to make sure it is rebuilt if missing
# but adding the dependances generate mess
testapi.c:
134
135
	-@(if [ "$(PYTHON)" != "" ] ; then \
	    $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi )
136
137
138
139
140
141

testapi_SOURCES=testapi.c
testapi_LDFLAGS = 
testapi_DEPENDENCIES = $(DEPS)
testapi_LDADD= $(LDADDS)

142
143
144
145
#testOOM_SOURCES=testOOM.c testOOMlib.h testOOMlib.c
#testOOM_LDFLAGS = 
#testOOM_DEPENDENCIES = $(DEPS)
#testOOM_LDADD= $(LDADDS)
146

147
check-local: all tests
148

149
testall : tests SVGtests SAXtests
150

151
tests: 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_THREADS@ Timingtests @TEST_VTIME@ @PYTHON_TESTS@ @TEST_MODULES@
152
153
154
	@(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; \
	    $(MAKE) MAKEFLAGS+=--silent tests ; fi)
	@(cd doc/examples ; $(MAKE) MAKEFLAGS+=--silent tests)
155

156
157
158
valgrind:
	@echo '## Running the regression tests under Valgrind'
	@echo '## Go get a cup of coffee it is gonna take a while ...'
159
	$(MAKE) CHECKER='valgrind' tests
160

161
162
163
164
APItests: testapi$(EXEEXT)
	@echo "## Running the API regression tests this may take a little while"
	-@($(CHECKER) $(top_builddir)/testapi -q)

165
HTMLtests : testHTML$(EXEEXT)
166
	@(echo > .memdump)
167
	@echo "## HTML regression tests"
168
	-@(for i in $(srcdir)/test/HTML/* ; do \
169
	  name=`basename $$i`; \
170
	  if [ ! -d $$i ] ; then \
171
172
	  if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
	      echo New test file $$name ; \
173
	      $(CHECKER) $(top_builddir)/testHTML $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \
174
	  else \
175
	      log=`$(CHECKER) $(top_builddir)/testHTML $$i > result.$$name 2> error.$$name ; \
176
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
177
	      diff $(srcdir)/result/HTML/$$name result.$$name ; \
178
	      diff -b $(srcdir)/result/HTML/$$name.err error.$$name ; \
179
	      $(CHECKER) $(top_builddir)/testHTML result.$$name > result2.$$name 2>error.$$name ; \
180
181
	      diff result.$$name result2.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
182
	      rm result.$$name result2.$$name error.$$name ; \
183
	  fi ; fi ; done)
184
185

HTMLPushtests : testHTML$(EXEEXT)
186
	@echo "## Push HTML regression tests"
187
	-@(for i in $(srcdir)/test/HTML/* ; do \
188
189
190
191
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
	      echo New test file $$name ; \
192
	      $(CHECKER) $(top_builddir)/testHTML --push $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \
193
	  else \
194
	      log=`$(CHECKER) $(top_builddir)/testHTML --push $$i > result.$$name 2> error.$$name ; \
195
196
197
198
199
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
	      diff $(srcdir)/result/HTML/$$name result.$$name ; \
	      cut -b 1-15 $(srcdir)/result/HTML/$$name.err > errorcut.$$name; \
	      cut -b 1-15 error.$$name > errorcut2.$$name; \
	      diff -b errorcut.$$name errorcut2.$$name ; \
200
	      $(CHECKER) $(top_builddir)/testHTML --push result.$$name > result2.$$name 2>error.$$name ; \
201
202
	      diff result.$$name result2.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
203
204
205
	      rm result.$$name result2.$$name error.$$name errorcut.$$name errorcut2.$$name ; \
	  fi ; fi ; done)
	@echo "## HTML SAX regression tests"
206
	-@(for i in $(srcdir)/test/HTML/* ; do \
207
208
209
210
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/HTML/$$name.sax ] ; then \
	      echo New test file $$name ; \
211
	      $(CHECKER) $(top_builddir)/testHTML --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \
212
	  else \
213
	      log=`$(CHECKER) $(top_builddir)/testHTML --sax $$i > result.$$name.sax ; \
214
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
215
216
	      diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
217
218
219
	      rm result.$$name.sax ; \
	  fi ; fi ; done)
	@echo "## Push HTML SAX regression tests"
220
	-@(for i in $(srcdir)/test/HTML/* ; do \
221
222
223
224
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
	      echo New test file $$name ; \
225
	      $(CHECKER) $(top_builddir)/testHTML --push --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \
226
	  else \
227
	      log=`$(CHECKER) $(top_builddir)/testHTML --push --sax $$i 2>&1 > result.$$name.sax ; \
228
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
229
230
	      diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
231
232
233
	      rm result.$$name.sax ; \
	  fi ; fi ; done)

234
XMLtests : xmllint$(EXEEXT)
235
	@(echo > .memdump)
236
	@echo "## XML regression tests"
237
	-@(for i in $(srcdir)/test/* ; do \
238
	  name=`basename $$i`; \
239
	  if [ ! -d $$i ] ; then \
240
241
	  if [ ! -f $(srcdir)/result/$$name ] ; then \
	      echo New test file $$name ; \
242
	      $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/$$name ; \
243
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
244
	  else \
245
	      log=`$(CHECKER) $(top_builddir)/xmllint $$i 2>&1 > result.$$name ; \
246
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
247
	      diff $(srcdir)/result/$$name result.$$name ; \
248
	      $(CHECKER) $(top_builddir)/xmllint result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \
249
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
250
251
	      diff result.$$name result2.$$name` ;\
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
252
	      rm result.$$name result2.$$name ; \
253
	  fi ; fi ; done)
254
	@echo "## XML regression tests on memory"
255
	-@(for i in $(srcdir)/test/* ; do \
256
257
258
259
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/$$name ] ; then \
	      echo New test file $$name ; \
260
	      $(CHECKER) $(top_builddir)/xmllint --memory $$i > $(srcdir)/result/$$name ; \
261
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
262
	  else \
263
	      log=`$(CHECKER) $(top_builddir)/xmllint --memory $$i 2>&1 > result.$$name ; \
264
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
265
	      diff $(srcdir)/result/$$name result.$$name ; \
266
267
268
	      $(CHECKER) $(top_builddir)/xmllint --memory result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"`; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
269
270
271
	      diff result.$$name result2.$$name ; \
	      rm result.$$name result2.$$name ; \
	  fi ; fi ; done)
272
273
274
275

XMLPushtests: xmllint$(EXEEXT)
	@(echo > .memdump)
	@echo "## XML push regression tests"
276
	-@(for i in $(srcdir)/test/* ; do \
277
278
279
280
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/$$name ] ; then \
	      echo New test file $$name ; \
281
	      $(CHECKER) $(top_builddir)/xmllint --push $$i > $(srcdir)/result/$$name ; \
282
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
283
	  else \
284
	      log=`$(CHECKER) $(top_builddir)/xmllint --push $$i 2>&1 > result.$$name ; \
285
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
286
	      diff $(srcdir)/result/$$name result.$$name ; \
287
	      $(CHECKER) $(top_builddir)/xmllint --push result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \
288
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
289
290
	      diff result.$$name result2.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
291
292
	      rm result.$$name result2.$$name ; \
	  fi ; fi ; done)
293

294
295
296
297
298
299
300
301
302
303
304
305
306
NStests : xmllint$(EXEEXT)
	@(echo > .memdump)
	@echo "## XML Namespaces regression tests"
	-@(for i in $(srcdir)/test/namespaces/* ; do \
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/namespaces/$$name ] ; then \
	      echo New test file $$name ; \
	      $(CHECKER) $(top_builddir)/xmllint $$i \
	         2> $(srcdir)/result/namespaces/$$name.err \
		 > $(srcdir)/result/namespaces/$$name ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
	  else \
307
	      log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \
308
309
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
	      diff $(srcdir)/result/namespaces/$$name result.$$name ; \
310
	      diff $(srcdir)/result/namespaces/$$name.err error.$$name`; \
311
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
312
313
314
	      rm result.$$name error.$$name ; \
	  fi ; fi ; done)

315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
IDtests : xmllint$(EXEEXT) testXPath$(EXEEXT)
	@(echo > .memdump)
	@echo "## xml:id regression tests"
	-@(for i in $(srcdir)/test/xmlid/id_*.xml ; do \
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/xmlid/$$name ] ; then \
	      echo New test file $$name ; \
	      $(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" \
	         2> $(srcdir)/result/xmlid/$$name.err \
		 > $(srcdir)/result/xmlid/$$name ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
	  else \
	      log=`$(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" 2> error.$$name > result.$$name ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
	      diff $(srcdir)/result/xmlid/$$name result.$$name ; \
	      diff $(srcdir)/result/xmlid/$$name.err error.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
	      rm result.$$name error.$$name ; \
	  fi ; fi ; done)

336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
Errtests : xmllint$(EXEEXT)
	@(echo > .memdump)
	@echo "## Error cases regression tests"
	-@(for i in $(srcdir)/test/errors/*.xml ; do \
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/errors/$$name ] ; then \
	      echo New test file $$name ; \
	      $(CHECKER) $(top_builddir)/xmllint $$i \
	         2> $(srcdir)/result/errors/$$name.err \
		 > $(srcdir)/result/errors/$$name ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
	  else \
	      log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
	      diff $(srcdir)/result/errors/$$name result.$$name ; \
	      diff $(srcdir)/result/errors/$$name.err error.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
	      rm result.$$name error.$$name ; \
	  fi ; fi ; done)
	@echo "## Error cases stream regression tests"
	-@(for i in $(srcdir)/test/errors/*.xml ; do \
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/errors/$$name.str ] ; then \
	      echo New test file $$name ; \
362
	      $(CHECKER) $(top_builddir)/xmllint --stream $$i \
363
	         2> $(srcdir)/result/errors/$$name.str \
364
		 > /dev/null ; \
365
366
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
	  else \
367
	      log=`$(CHECKER) $(top_builddir)/xmllint --stream $$i 2> error.$$name > /dev/null ; \
368
369
370
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
	      diff $(srcdir)/result/errors/$$name.str error.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
371
	      rm error.$$name ; \
372
373
	  fi ; fi ; done)

374
Docbtests : xmllint$(EXEEXT)
375

376
XMLenttests : xmllint$(EXEEXT)
377
	@(echo > .memdump)
378
	@echo "## XML entity subst regression tests"
379
	-@(for i in $(srcdir)/test/* ; do \
380
	  name=`basename $$i`; \
381
	  if [ ! -d $$i ] ; then \
382
383
	  if [ ! -f $(srcdir)/result/noent/$$name ] ; then \
	      echo New test file $$name ; \
384
	      $(CHECKER) $(top_builddir)/xmllint --noent $$i > $(srcdir)/result/noent/$$name ; \
385
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
386
	  else \
387
	      log=`$(CHECKER) $(top_builddir)/xmllint --noent $$i 2>&1 > result.$$name ; \
388
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
389
	      diff $(srcdir)/result/noent/$$name result.$$name ; \
390
	      $(CHECKER) $(top_builddir)/xmllint --noent result.$$name 2>&1 > result2.$$name ; \
391
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
392
393
	      diff result.$$name result2.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
394
	      rm result.$$name result2.$$name ; \
395
396
	  fi ; fi ; done)

397
URItests : testURI$(EXEEXT)
398
	@(echo > .memdump)
399
	@echo "## URI module regression tests"
400
	-@(for i in $(srcdir)/test/URI/*.data ; do \
401
402
403
404
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/URI/$$name ] ; then \
	      echo New test file $$name ; \
405
	      $(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i > $(srcdir)/result/URI/$$name ; \
406
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
407
	  else \
408
	      log=`$(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i 2>&1 > result.$$name ; \
409
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
410
411
	      diff $(srcdir)/result/URI/$$name result.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
412
413
	      rm result.$$name ; \
	  fi ; fi ; done)
414
	-@(for i in $(srcdir)/test/URI/*.uri ; do \
415
416
417
418
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/URI/$$name ] ; then \
	      echo New test file $$name ; \
419
	      $(CHECKER) $(top_builddir)/testURI < $$i > $(srcdir)/result/URI/$$name ; \
420
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
421
	  else \
422
	      log=`$(CHECKER) $(top_builddir)/testURI < $$i 2>&1 > result.$$name ; \
423
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
424
425
	      diff $(srcdir)/result/URI/$$name result.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
426
427
	      rm result.$$name ; \
	  fi ; fi ; done)
428

429
XPathtests : testXPath$(EXEEXT)
430
	@(echo > .memdump)
431
	@echo "## XPath regression tests"
432
	-@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \
433
434
	  then echo Skipping debug not compiled in ; exit 0 ; fi ; \
	  for i in $(srcdir)/test/XPath/expr/* ; do \
435
	  name=`basename $$i`; \
436
	  if [ ! -d $$i ] ; then \
437
438
	  if [ ! -f $(srcdir)/result/XPath/expr/$$name ] ; then \
	      echo New test file $$name ; \
439
	      $(CHECKER) $(top_builddir)/testXPath -f --expr $$i > $(srcdir)/result/XPath/expr/$$name ; \
440
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
441
	  else \
442
	      log=`$(CHECKER) $(top_builddir)/testXPath -f --expr $$i 2>&1 > result.$$name ; \
443
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
444
445
	      diff $(srcdir)/result/XPath/expr/$$name result.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
446
	      rm result.$$name ; \
447
448
	  fi ; fi ; done ; \
	  for i in $(srcdir)/test/XPath/docs/* ; do \
449
	  if [ ! -d $$i ] ; then \
450
451
	  doc=`basename $$i`; \
	  for j in $(srcdir)/test/XPath/tests/$$doc* ; do \
452
	  if [ ! -f $$j ] ; then continue ; fi ; \
453
	  name=`basename $$j`; \
454
	  if [ ! -d $$j ] ; then \
455
456
	  if [ ! -f $(srcdir)/result/XPath/tests/$$name ] ; then \
	      echo New test file $$name ; \
457
	      $(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j > $(srcdir)/result/XPath/tests/$$name ; \
458
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
459
	  else \
460
	      log=`$(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j 2>&1 > result.$$name ; \
461
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
462
463
	      diff $(srcdir)/result/XPath/tests/$$name result.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
464
	      rm result.$$name ; \
465
466
	  fi ; fi ; done ; fi ; done)

467
XPtrtests : testXPath$(EXEEXT)
468
	@(echo > .memdump)
469
	@echo "## XPointer regression tests"
470
	-@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \
471
472
	  then echo Skipping debug not compiled in ; exit 0 ; fi ; \
	  for i in $(srcdir)/test/XPath/docs/* ; do \
473
474
475
476
477
478
479
480
	  if [ ! -d $$i ] ; then \
	  doc=`basename $$i`; \
	  for j in $(srcdir)/test/XPath/xptr/$$doc* ; do \
	  if [ ! -f $$j ] ; then continue ; fi ; \
	  name=`basename $$j`; \
	  if [ ! -d $$j ] ; then \
	  if [ ! -f $(srcdir)/result/XPath/xptr/$$name ] ; then \
	      echo New test file $$name ; \
481
482
	      $(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j > $(srcdir)/result/XPath/xptr/$$name ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
483
	  else \
484
	      log=`$(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j 2>&1 > result.$$name ; \
485
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
486
487
	      diff $(srcdir)/result/XPath/xptr/$$name result.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
488
489
490
	      rm result.$$name ; \
	  fi ; fi ; done ; fi ; done)

491
XIncludetests : xmllint$(EXEEXT)
492
	@(echo > .memdump)
493
	@echo "## XInclude regression tests"
494
	-@(for i in $(srcdir)/test/XInclude/docs/* ; do \
495
496
497
498
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \
	      echo New test file $$name ; \
499
	      $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \
500
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
501
	  else \
502
	      log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > result.$$name 2>error.$$name ; \
503
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
504
505
	      diff $(srcdir)/result/XInclude/$$name result.$$name ; \
	      diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \
506
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
507
	      rm result.$$name error.$$name ; \
508
	  fi ; fi ; done)
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
	-@(for i in $(srcdir)/test/XInclude/docs/* ; do \
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \
	      echo New test file $$name ; \
	      $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
	  else \
	      log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > result.$$name 2>error.$$name ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
	      diff $(srcdir)/result/XInclude/$$name result.$$name ; \
	      diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
	      rm result.$$name error.$$name ; \
	  fi ; fi ; done)
524
525
526
527
528
529
530
	@(echo > .memdump)
	@echo "## XInclude xmlReader regression tests"
	-@(for i in $(srcdir)/test/XInclude/docs/* ; do \
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \
	      echo New test file $$name ; \
531
	      $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \
532
533
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
	  else \
534
	      log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \
535
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
536
	      diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \
537
538
	      diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
539
	      rm result.$$name error.$$name ; \
540
	  fi ; fi ; done)
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
	-@(for i in $(srcdir)/test/XInclude/docs/* ; do \
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \
	      echo New test file $$name ; \
	      $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
	  else \
	      log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
	      diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \
	      diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
	      rm result.$$name error.$$name ; \
	  fi ; fi ; done)
556

557
Scripttests : xmllint$(EXEEXT)
558
559
560
	@(echo > .memdump)
	@echo "## Scripts regression tests"
	@echo "## Some of the base computations may be different if srcdir != ."
561
	-@(for i in $(srcdir)/test/scripts/*.script ; do \
562
563
564
565
566
	  name=`basename $$i .script`; \
	  xml=$(srcdir)/test/scripts/`basename $$i .script`.xml; \
	  if [ -f $$xml ] ; then \
	  if [ ! -f $(srcdir)/result/scripts/$$name ] ; then \
	      echo New test file $$name ; \
567
	      $(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > $(srcdir)/result/scripts/$$name 2> $(srcdir)/result/scripts/$$name.err ; \
568
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
569
	  else \
570
	      log=`$(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > result.$$name 2> result.$$name.err ; \
571
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
572
573
	      diff $(srcdir)/result/scripts/$$name result.$$name ; \
	      diff $(srcdir)/result/scripts/$$name.err result.$$name.err` ; \
574
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
575
	      rm result.$$name result.$$name.err ; \
576
577
	  fi ; fi ; done)

578
Catatests : xmlcatalog$(EXEEXT)
579
580
	@(echo > .memdump)
	@echo "## Catalog regression tests"
581
	-@(for i in $(srcdir)/test/catalogs/*.script ; do \
582
583
584
585
586
	  name=`basename $$i .script`; \
	  xml=$(srcdir)/test/catalogs/`basename $$i .script`.xml; \
	  if [ -f $$xml ] ; then \
	  if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
	      echo New test file $$name ; \
587
	      $(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > $(srcdir)/result/catalogs/$$name ; \
588
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
589
	  else \
590
	      log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > result.$$name ; \
591
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
592
593
	      diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
594
595
	      rm result.$$name ; \
	  fi ; fi ; done)
596
	-@(for i in $(srcdir)/test/catalogs/*.script ; do \
597
598
599
600
601
	  name=`basename $$i .script`; \
	  sgml=$(srcdir)/test/catalogs/`basename $$i .script`.sgml; \
	  if [ -f $$sgml ] ; then \
	  if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
	      echo New test file $$name ; \
602
	      $(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > $(srcdir)/result/catalogs/$$name ; \
603
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
604
	  else \
605
	      log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \
606
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
607
608
	      diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
609
610
	      rm result.$$name ; \
	  fi ; fi ; done)
611
	@echo "## Add and del operations on XML Catalogs"
612
	-@($(CHECKER) $(top_builddir)/xmlcatalog --create --noout $(srcdir)/result/catalogs/mycatalog; \
613
	grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
614
	$(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid sysid $(srcdir)/result/catalogs/mycatalog; \
615
	grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
616
	$(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid2 sysid2 $(srcdir)/result/catalogs/mycatalog; \
617
	grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
618
	$(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid3 sysid3 $(srcdir)/result/catalogs/mycatalog; \
619
	grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
620
	diff result/catalogs/mycatalog.full $(srcdir)/result/catalogs/mycatalog; \
621
	grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
622
	$(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid $(srcdir)/result/catalogs/mycatalog; \
623
	grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
624
	$(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid3 $(srcdir)/result/catalogs/mycatalog; \
625
	grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
626
	$(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid2 $(srcdir)/result/catalogs/mycatalog; \
627
	grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
628
	diff result/catalogs/mycatalog.empty $(srcdir)/result/catalogs/mycatalog; \
629
	grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
630
	rm -f $(srcdir)/result/catalogs/mycatalog)
631

632
SVGtests : xmllint$(EXEEXT)
633
	@echo "## SVG parsing regression tests"
634
	-@(for i in $(srcdir)/test/SVG/* ; do \
635
	  name=`basename $$i`; \
636
	  if [ ! -d $$i ] ; then \
637
638
	  if [ ! -f $(srcdir)/result/SVG/$$name ] ; then \
	      echo New test file $$name ; \
639
	      $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/SVG/$$name ; \
640
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
641
	  else \
642
	      echo Testing $$name ; \
643
	      $(CHECKER) $(top_builddir)/xmllint $$i > result.$$name ; \
644
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
645
	      diff $(srcdir)/result/SVG/$$name result.$$name ; \
646
	      $(CHECKER) $(top_builddir)/xmllint result.$$name > result2.$$name ; \
647
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
648
649
	      diff result.$$name result2.$$name ; \
	      rm result.$$name result2.$$name ; \
650
651
	  fi ; fi ; done)

652
Threadtests : testThreads$(EXEEXT)
653
	@echo "## Threaded regression tests"
654
655
656
	-@($(CHECKER) $(top_builddir)/testThreads ; \
	   grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
	   exit 0)
657

658
Readertests : xmllint$(EXEEXT)
659
660
661
662
663
664
665
666
667
668
	@(echo > .memdump)
	@echo "## Reader regression tests"
	-@(for i in $(srcdir)/test/* ; do \
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \
	      echo New test file $$name ; \
	      $(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
	  else \
669
	      log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
670
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
671
672
	      diff $(srcdir)/result/$$name.rdr result.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
673
674
	      rm result.$$name ; \
	  fi ; fi ; done)
675
676
677
678
679
680
681
682
683
	@echo "## Reader on memory regression tests"
	-@(for i in $(srcdir)/test/* ; do \
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \
	      echo New test file $$name ; \
	      $(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
	  else \
684
	      log=`$(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
685
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
686
687
	      diff $(srcdir)/result/$$name.rdr result.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
688
689
	      rm result.$$name ; \
	  fi ; fi ; done)
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
	@(echo > .memdump)
	@echo "## Walker regression tests"
	-@(for i in $(srcdir)/test/* ; do \
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \
	      echo New test file $$name ; \
	      $(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
	  else \
	      log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > result.$$name 2>/dev/null ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
	      diff $(srcdir)/result/$$name.rdr result.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
	      rm result.$$name ; \
	  fi ; fi ; done)
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
	@echo "## Reader entities substitution regression tests"
	-@(for i in $(srcdir)/test/* ; do \
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/$$name.rde ] ; then \
	      echo New test file $$name ; \
	      $(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > $(srcdir)/result/$$name.rde 2>/dev/null ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
	  else \
	      log=`$(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
	      diff $(srcdir)/result/$$name.rde result.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
	      rm result.$$name ; \
	  fi ; fi ; done)

722
SAXtests : testSAX$(EXEEXT)
723
	@(echo > .memdump)
724
	@echo "## SAX callbacks regression tests"
725
	-@(for i in $(srcdir)/test/* ; do \
726
727
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
728
	  if [ ! -f $(srcdir)/result/$$name.sax ] ; then \
729
	      echo New test file $$name ; \
730
	      $(CHECKER) $(top_builddir)/testSAX $$i > $(srcdir)/result/$$name.sax 2> /dev/null ; \
731
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
732
	  else \
733
	      log=`$(CHECKER) $(top_builddir)/testSAX $$i > result.$$name 2> /dev/null ; \
734
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
735
736
	      diff $(srcdir)/result/$$name.sax result.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
737
738
	      rm result.$$name ; \
	  fi ; fi ; done)
739

740
Validtests : xmllint$(EXEEXT)
741
	@(echo > .memdump)
742
	@echo "## Valid documents regression tests"
743
	-@(for i in $(srcdir)/test/VCM/* ; do \
744
745
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
746
747
748
	      log=`$(CHECKER) $(top_builddir)/xmllint --valid --noout --nowarning $$i ; \
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"`;\
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
749
	  fi ; done ; exit 0)
750
	@echo "## Validity checking regression tests"
751
	-@(for i in $(srcdir)/test/VC/* ; do \
752
753
754
755
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/VC/$$name ] ; then \
	      echo New test file $$name ; \
756
	      $(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> $(srcdir)/result/VC/$$name ; \
757
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
758
	  else \
759
	      log=`$(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> result.$$name ; \
760
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
761
762
	      diff $(srcdir)/result/VC/$$name result.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
763
764
	      rm result.$$name ; \
	  fi ; fi ; done)
765
	@echo "## General documents valid regression tests"
766
	-@(for i in $(srcdir)/test/valid/* ; do \
767
768
769
770
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/valid/$$name ] ; then \
	      echo New test file $$name ; \
771
	      $(CHECKER) $(top_builddir)/xmllint --valid $$i > $(srcdir)/result/valid/$$name 2>$(srcdir)/result/valid/$$name.err ; \
772
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
773
	  else \
774
	      log=`$(CHECKER) $(top_builddir)/xmllint --valid $$i > result.$$name 2>error.$$name ; \
775
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
776
	      diff $(srcdir)/result/valid/$$name result.$$name ; \
777
778
	      diff $(srcdir)/result/valid/$$name.err error.$$name` ; \
	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
779
	      rm result.$$name error.$$name ; \
780
	  fi ; fi ; done)
781

782
783
784
785
786
787
788
789
790
Regexptests: testRegexp$(EXEEXT)
	@(echo > .memdump)
	@echo "## Regexp regression tests"
	-@(for i in $(srcdir)/test/regexp/* ; do \
	  name=`basename $$i`; \
	  if [ ! -d $$i ] ; then \
	  if [ ! -f $(srcdir)/result/regexp/$$name ] ; then \
	      echo New test file $$name ; \
	      $(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name; \
791
	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
792
	  else \