Makefile.am 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262
  1. ## Process this file with automake to produce Makefile.in
  2. ACLOCAL_AMFLAGS = -I m4
  3. SUBDIRS = include . doc example xstc @PYTHON_SUBDIR@
  4. DIST_SUBDIRS = include . doc example python xstc
  5. INCLUDES = -I$(top_builddir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@
  6. noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \
  7. testThreads testC14N testAutomata testRegexp \
  8. testReader testapi testModule runtest runsuite testchar \
  9. testdict runxmlconf testrecurse
  10. bin_PROGRAMS = xmllint xmlcatalog
  11. bin_SCRIPTS=xml2-config
  12. lib_LTLIBRARIES = libxml2.la
  13. libxml2_la_LIBADD = @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) @M_LIBS@ @WIN32_EXTRA_LIBADD@
  14. if USE_VERSION_SCRIPT
  15. LIBXML2_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxml2.syms
  16. else
  17. LIBXML2_VERSION_SCRIPT =
  18. endif
  19. libxml2_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ \
  20. $(LIBXML2_VERSION_SCRIPT) \
  21. -version-info @LIBXML_VERSION_INFO@ \
  22. @MODULE_PLATFORM_LIBS@
  23. if WITH_TRIO_SOURCES
  24. libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
  25. parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \
  26. valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \
  27. xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \
  28. catalog.c globals.c threads.c c14n.c xmlstring.c \
  29. xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
  30. triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c \
  31. xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \
  32. xmlmodule.c schematron.c
  33. else
  34. libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
  35. parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \
  36. valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \
  37. xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \
  38. catalog.c globals.c threads.c c14n.c xmlstring.c \
  39. xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
  40. xmlreader.c relaxng.c dict.c SAX2.c \
  41. xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \
  42. xmlmodule.c schematron.c
  43. endif
  44. DEPS = $(top_builddir)/libxml2.la
  45. LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) @M_LIBS@ @WIN32_EXTRA_LIBADD@
  46. man_MANS = xml2-config.1 libxml.3
  47. m4datadir = $(datadir)/aclocal
  48. m4data_DATA = libxml.m4
  49. runtest_SOURCES=runtest.c
  50. runtest_LDFLAGS =
  51. runtest_DEPENDENCIES = $(DEPS)
  52. runtest_LDADD= @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS)
  53. testrecurse_SOURCES=testrecurse.c
  54. testrecurse_LDFLAGS =
  55. testrecurse_DEPENDENCIES = $(DEPS)
  56. testrecurse_LDADD= @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS)
  57. testchar_SOURCES=testchar.c
  58. testchar_LDFLAGS =
  59. testchar_DEPENDENCIES = $(DEPS)
  60. testchar_LDADD= @RDL_LIBS@ $(LDADDS)
  61. testdict_SOURCES=testdict.c
  62. testdict_LDFLAGS =
  63. testdict_DEPENDENCIES = $(DEPS)
  64. testdict_LDADD= @RDL_LIBS@ $(LDADDS)
  65. runsuite_SOURCES=runsuite.c
  66. runsuite_LDFLAGS =
  67. runsuite_DEPENDENCIES = $(DEPS)
  68. runsuite_LDADD= @RDL_LIBS@ $(LDADDS)
  69. xmllint_SOURCES=xmllint.c
  70. xmllint_LDFLAGS =
  71. xmllint_DEPENDENCIES = $(DEPS)
  72. xmllint_LDADD= @RDL_LIBS@ $(LDADDS)
  73. testSAX_SOURCES=testSAX.c
  74. testSAX_LDFLAGS =
  75. testSAX_DEPENDENCIES = $(DEPS)
  76. testSAX_LDADD= $(LDADDS)
  77. testHTML_SOURCES=testHTML.c
  78. testHTML_LDFLAGS =
  79. testHTML_DEPENDENCIES = $(DEPS)
  80. testHTML_LDADD= $(LDADDS)
  81. xmlcatalog_SOURCES=xmlcatalog.c
  82. xmlcatalog_LDFLAGS =
  83. xmlcatalog_DEPENDENCIES = $(DEPS)
  84. xmlcatalog_LDADD= @RDL_LIBS@ $(LDADDS)
  85. testXPath_SOURCES=testXPath.c
  86. testXPath_LDFLAGS =
  87. testXPath_DEPENDENCIES = $(DEPS)
  88. testXPath_LDADD= $(LDADDS)
  89. testC14N_SOURCES=testC14N.c
  90. testC14N_LDFLAGS =
  91. testC14N_DEPENDENCIES = $(DEPS)
  92. testC14N_LDADD= $(LDADDS)
  93. testThreads_SOURCES=testThreads@THREADS_W32@.c
  94. testThreads_LDFLAGS =
  95. testThreads_DEPENDENCIES = $(DEPS)
  96. testThreads_LDADD= @BASE_THREAD_LIBS@ $(LDADDS)
  97. testURI_SOURCES=testURI.c
  98. testURI_LDFLAGS =
  99. testURI_DEPENDENCIES = $(DEPS)
  100. testURI_LDADD= $(LDADDS)
  101. testRegexp_SOURCES=testRegexp.c
  102. testRegexp_LDFLAGS =
  103. testRegexp_DEPENDENCIES = $(DEPS)
  104. testRegexp_LDADD= $(LDADDS)
  105. testAutomata_SOURCES=testAutomata.c
  106. testAutomata_LDFLAGS =
  107. testAutomata_DEPENDENCIES = $(DEPS)
  108. testAutomata_LDADD= $(LDADDS)
  109. testSchemas_SOURCES=testSchemas.c
  110. testSchemas_LDFLAGS =
  111. testSchemas_DEPENDENCIES = $(DEPS)
  112. testSchemas_LDADD= $(LDADDS)
  113. testRelax_SOURCES=testRelax.c
  114. testRelax_LDFLAGS =
  115. testRelax_DEPENDENCIES = $(DEPS)
  116. testRelax_LDADD= $(LDADDS)
  117. testReader_SOURCES=testReader.c
  118. testReader_LDFLAGS =
  119. testReader_DEPENDENCIES = $(DEPS)
  120. testReader_LDADD= $(LDADDS)
  121. testModule_SOURCES=testModule.c
  122. testModule_LDFLAGS =
  123. testModule_DEPENDENCIES = $(DEPS)
  124. testModule_LDADD= $(LDADDS)
  125. noinst_LTLIBRARIES = testdso.la
  126. testdso_la_SOURCES = testdso.c
  127. testdso_la_LDFLAGS = -module -no-undefined -avoid-version -rpath $(libdir)
  128. # that one forces the rebuild when "make rebuild" is run on doc/
  129. rebuild_testapi:
  130. -@(if [ "$(PYTHON)" != "" ] ; then \
  131. $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi )
  132. # that one is just to make sure it is rebuilt if missing
  133. # but adding the dependances generate mess
  134. testapi.c: $(srcdir)/gentest.py
  135. -@(if [ "$(PYTHON)" != "" ] ; then \
  136. $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi )
  137. testapi_SOURCES=testapi.c
  138. testapi_LDFLAGS =
  139. testapi_DEPENDENCIES = $(DEPS)
  140. testapi_LDADD= $(LDADDS)
  141. runxmlconf_SOURCES=runxmlconf.c
  142. runxmlconf_LDFLAGS =
  143. runxmlconf_DEPENDENCIES = $(DEPS)
  144. runxmlconf_LDADD= $(LDADDS)
  145. #testOOM_SOURCES=testOOM.c testOOMlib.h testOOMlib.c
  146. #testOOM_LDFLAGS =
  147. #testOOM_DEPENDENCIES = $(DEPS)
  148. #testOOM_LDADD= $(LDADDS)
  149. runtests:
  150. $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT)
  151. @(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; \
  152. $(MAKE) MAKEFLAGS+=--silent tests ; fi)
  153. check: all runtests
  154. check-valgrind: all
  155. @echo '## Running the regression tests under Valgrind'
  156. @echo '## Go get a cup of coffee it is gonna take a while ...'
  157. $(MAKE) CHECKER='valgrind -q' check
  158. testall : tests SVGtests SAXtests
  159. 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_SCHEMATRON@ @TEST_THREADS@ Timingtests @TEST_VTIME@ @PYTHON_TESTS@ @TEST_MODULES@
  160. @(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; \
  161. $(MAKE) MAKEFLAGS+=--silent tests ; fi)
  162. @(cd doc/examples ; $(MAKE) MAKEFLAGS+=--silent tests)
  163. valgrind:
  164. @echo '## Running the regression tests under Valgrind'
  165. @echo '## Go get a cup of coffee it is gonna take a while ...'
  166. $(MAKE) CHECKER='valgrind -q' tests
  167. APItests: testapi$(EXEEXT)
  168. @echo "## Running the API regression tests this may take a little while"
  169. -@($(CHECKER) $(top_builddir)/testapi -q)
  170. HTMLtests : testHTML$(EXEEXT)
  171. @(echo > .memdump)
  172. @echo "## HTML regression tests"
  173. -@(for i in $(srcdir)/test/HTML/* ; do \
  174. name=`basename $$i`; \
  175. if [ ! -d $$i ] ; then \
  176. if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
  177. echo New test file $$name ; \
  178. $(CHECKER) $(top_builddir)/testHTML $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \
  179. else \
  180. log=`$(CHECKER) $(top_builddir)/testHTML $$i > result.$$name 2> error.$$name ; \
  181. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  182. diff $(srcdir)/result/HTML/$$name result.$$name ; \
  183. diff -b $(srcdir)/result/HTML/$$name.err error.$$name ; \
  184. $(CHECKER) $(top_builddir)/testHTML result.$$name > result2.$$name 2>error.$$name ; \
  185. diff result.$$name result2.$$name` ; \
  186. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  187. rm result.$$name result2.$$name error.$$name ; \
  188. fi ; fi ; done)
  189. HTMLPushtests : testHTML$(EXEEXT)
  190. @echo "## Push HTML regression tests"
  191. -@(for i in $(srcdir)/test/HTML/* ; do \
  192. name=`basename $$i`; \
  193. if [ ! -d $$i ] ; then \
  194. if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
  195. echo New test file $$name ; \
  196. $(CHECKER) $(top_builddir)/testHTML --push $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \
  197. else \
  198. log=`$(CHECKER) $(top_builddir)/testHTML --push $$i > result.$$name 2> error.$$name ; \
  199. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  200. diff $(srcdir)/result/HTML/$$name result.$$name ; \
  201. cut -b 1-15 $(srcdir)/result/HTML/$$name.err > errorcut.$$name; \
  202. cut -b 1-15 error.$$name > errorcut2.$$name; \
  203. diff -b errorcut.$$name errorcut2.$$name ; \
  204. $(CHECKER) $(top_builddir)/testHTML --push result.$$name > result2.$$name 2>error.$$name ; \
  205. diff result.$$name result2.$$name` ; \
  206. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  207. rm result.$$name result2.$$name error.$$name errorcut.$$name errorcut2.$$name ; \
  208. fi ; fi ; done)
  209. @echo "## HTML SAX regression tests"
  210. -@(for i in $(srcdir)/test/HTML/* ; do \
  211. name=`basename $$i`; \
  212. if [ ! -d $$i ] ; then \
  213. if [ ! -f $(srcdir)/result/HTML/$$name.sax ] ; then \
  214. echo New test file $$name ; \
  215. $(CHECKER) $(top_builddir)/testHTML --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \
  216. else \
  217. log=`$(CHECKER) $(top_builddir)/testHTML --sax $$i > result.$$name.sax ; \
  218. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  219. diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \
  220. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  221. rm result.$$name.sax ; \
  222. fi ; fi ; done)
  223. @echo "## Push HTML SAX regression tests"
  224. -@(for i in $(srcdir)/test/HTML/* ; do \
  225. name=`basename $$i`; \
  226. if [ ! -d $$i ] ; then \
  227. if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
  228. echo New test file $$name ; \
  229. $(CHECKER) $(top_builddir)/testHTML --push --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \
  230. else \
  231. log=`$(CHECKER) $(top_builddir)/testHTML --push --sax $$i 2>&1 > result.$$name.sax ; \
  232. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  233. diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \
  234. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  235. rm result.$$name.sax ; \
  236. fi ; fi ; done)
  237. XMLtests : xmllint$(EXEEXT)
  238. @(echo > .memdump)
  239. @echo "## XML regression tests"
  240. -@(for i in $(srcdir)/test/* ; do \
  241. name=`basename $$i`; \
  242. if [ ! -d $$i ] ; then \
  243. if [ ! -f $(srcdir)/result/$$name ] ; then \
  244. echo New test file $$name ; \
  245. $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/$$name ; \
  246. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  247. else \
  248. log=`$(CHECKER) $(top_builddir)/xmllint $$i 2>&1 > result.$$name ; \
  249. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  250. diff $(srcdir)/result/$$name result.$$name ; \
  251. $(CHECKER) $(top_builddir)/xmllint result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \
  252. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  253. diff result.$$name result2.$$name` ;\
  254. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  255. rm result.$$name result2.$$name ; \
  256. fi ; fi ; done)
  257. @echo "## XML regression tests on memory"
  258. -@(for i in $(srcdir)/test/* ; do \
  259. name=`basename $$i`; \
  260. if [ ! -d $$i ] ; then \
  261. if [ ! -f $(srcdir)/result/$$name ] ; then \
  262. echo New test file $$name ; \
  263. $(CHECKER) $(top_builddir)/xmllint --memory $$i > $(srcdir)/result/$$name ; \
  264. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  265. else \
  266. log=`$(CHECKER) $(top_builddir)/xmllint --memory $$i 2>&1 > result.$$name ; \
  267. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  268. diff $(srcdir)/result/$$name result.$$name ; \
  269. $(CHECKER) $(top_builddir)/xmllint --memory result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \
  270. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`; \
  271. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  272. diff result.$$name result2.$$name ; \
  273. rm result.$$name result2.$$name ; \
  274. fi ; fi ; done)
  275. XMLPushtests: xmllint$(EXEEXT)
  276. @(echo > .memdump)
  277. @echo "## XML push regression tests"
  278. -@(for i in $(srcdir)/test/* ; do \
  279. name=`basename $$i`; \
  280. if [ ! -d $$i ] ; then \
  281. if [ ! -f $(srcdir)/result/$$name ] ; then \
  282. echo New test file $$name ; \
  283. $(CHECKER) $(top_builddir)/xmllint --push $$i > $(srcdir)/result/$$name ; \
  284. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  285. else \
  286. log=`$(CHECKER) $(top_builddir)/xmllint --push $$i 2>&1 > result.$$name ; \
  287. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  288. diff $(srcdir)/result/$$name result.$$name ; \
  289. $(CHECKER) $(top_builddir)/xmllint --push result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \
  290. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  291. diff result.$$name result2.$$name` ; \
  292. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  293. rm result.$$name result2.$$name ; \
  294. fi ; fi ; done)
  295. NStests : xmllint$(EXEEXT)
  296. @(echo > .memdump)
  297. @echo "## XML Namespaces regression tests"
  298. -@(for i in $(srcdir)/test/namespaces/* ; do \
  299. name=`basename $$i`; \
  300. if [ ! -d $$i ] ; then \
  301. if [ ! -f $(srcdir)/result/namespaces/$$name ] ; then \
  302. echo New test file $$name ; \
  303. $(CHECKER) $(top_builddir)/xmllint $$i \
  304. 2> $(srcdir)/result/namespaces/$$name.err \
  305. > $(srcdir)/result/namespaces/$$name ; \
  306. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  307. else \
  308. log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \
  309. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  310. diff $(srcdir)/result/namespaces/$$name result.$$name ; \
  311. diff $(srcdir)/result/namespaces/$$name.err error.$$name`; \
  312. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  313. rm result.$$name error.$$name ; \
  314. fi ; fi ; done)
  315. IDtests : xmllint$(EXEEXT) testXPath$(EXEEXT)
  316. @(echo > .memdump)
  317. @echo "## xml:id regression tests"
  318. -@(for i in $(srcdir)/test/xmlid/id_*.xml ; do \
  319. name=`basename $$i`; \
  320. if [ ! -d $$i ] ; then \
  321. if [ ! -f $(srcdir)/result/xmlid/$$name ] ; then \
  322. echo New test file $$name ; \
  323. $(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" \
  324. 2> $(srcdir)/result/xmlid/$$name.err \
  325. > $(srcdir)/result/xmlid/$$name ; \
  326. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  327. else \
  328. log=`$(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" 2> error.$$name > result.$$name ; \
  329. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  330. diff $(srcdir)/result/xmlid/$$name result.$$name ; \
  331. diff $(srcdir)/result/xmlid/$$name.err error.$$name` ; \
  332. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  333. rm result.$$name error.$$name ; \
  334. fi ; fi ; done)
  335. Errtests : xmllint$(EXEEXT)
  336. @(echo > .memdump)
  337. @echo "## Error cases regression tests"
  338. -@(for i in $(srcdir)/test/errors/*.xml ; do \
  339. name=`basename $$i`; \
  340. if [ ! -d $$i ] ; then \
  341. if [ ! -f $(srcdir)/result/errors/$$name ] ; then \
  342. echo New test file $$name ; \
  343. $(CHECKER) $(top_builddir)/xmllint $$i \
  344. 2> $(srcdir)/result/errors/$$name.err \
  345. > $(srcdir)/result/errors/$$name ; \
  346. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  347. else \
  348. log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \
  349. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  350. diff $(srcdir)/result/errors/$$name result.$$name ; \
  351. diff $(srcdir)/result/errors/$$name.err error.$$name` ; \
  352. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  353. rm result.$$name error.$$name ; \
  354. fi ; fi ; done)
  355. @echo "## Error cases stream regression tests"
  356. -@(for i in $(srcdir)/test/errors/*.xml ; do \
  357. name=`basename $$i`; \
  358. if [ ! -d $$i ] ; then \
  359. if [ ! -f $(srcdir)/result/errors/$$name.str ] ; then \
  360. echo New test file $$name ; \
  361. $(CHECKER) $(top_builddir)/xmllint --stream $$i \
  362. 2> $(srcdir)/result/errors/$$name.str \
  363. > /dev/null ; \
  364. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  365. else \
  366. log=`$(CHECKER) $(top_builddir)/xmllint --stream $$i 2> error.$$name > /dev/null ; \
  367. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  368. diff $(srcdir)/result/errors/$$name.str error.$$name` ; \
  369. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  370. rm error.$$name ; \
  371. fi ; fi ; done)
  372. Docbtests : xmllint$(EXEEXT)
  373. XMLenttests : xmllint$(EXEEXT)
  374. @(echo > .memdump)
  375. @echo "## XML entity subst regression tests"
  376. -@(for i in $(srcdir)/test/* ; do \
  377. name=`basename $$i`; \
  378. if [ ! -d $$i ] ; then \
  379. if [ ! -f $(srcdir)/result/noent/$$name ] ; then \
  380. echo New test file $$name ; \
  381. $(CHECKER) $(top_builddir)/xmllint --noent $$i > $(srcdir)/result/noent/$$name ; \
  382. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  383. else \
  384. log=`$(CHECKER) $(top_builddir)/xmllint --noent $$i 2>&1 > result.$$name ; \
  385. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  386. diff $(srcdir)/result/noent/$$name result.$$name ; \
  387. $(CHECKER) $(top_builddir)/xmllint --noent result.$$name 2>&1 > result2.$$name ; \
  388. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  389. diff result.$$name result2.$$name` ; \
  390. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  391. rm result.$$name result2.$$name ; \
  392. fi ; fi ; done)
  393. URItests : testURI$(EXEEXT)
  394. @(echo > .memdump)
  395. @echo "## URI module regression tests"
  396. -@(for i in $(srcdir)/test/URI/*.data ; do \
  397. name=`basename $$i`; \
  398. if [ ! -d $$i ] ; then \
  399. if [ ! -f $(srcdir)/result/URI/$$name ] ; then \
  400. echo New test file $$name ; \
  401. $(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i > $(srcdir)/result/URI/$$name ; \
  402. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  403. else \
  404. log=`$(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i 2>&1 > result.$$name ; \
  405. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  406. diff $(srcdir)/result/URI/$$name result.$$name` ; \
  407. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  408. rm result.$$name ; \
  409. fi ; fi ; done)
  410. -@(for i in $(srcdir)/test/URI/*.uri ; do \
  411. name=`basename $$i`; \
  412. if [ ! -d $$i ] ; then \
  413. if [ ! -f $(srcdir)/result/URI/$$name ] ; then \
  414. echo New test file $$name ; \
  415. $(CHECKER) $(top_builddir)/testURI < $$i > $(srcdir)/result/URI/$$name ; \
  416. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  417. else \
  418. log=`$(CHECKER) $(top_builddir)/testURI < $$i 2>&1 > result.$$name ; \
  419. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  420. diff $(srcdir)/result/URI/$$name result.$$name` ; \
  421. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  422. rm result.$$name ; \
  423. fi ; fi ; done)
  424. XPathtests : testXPath$(EXEEXT)
  425. @(echo > .memdump)
  426. @echo "## XPath regression tests"
  427. -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \
  428. then echo Skipping debug not compiled in ; exit 0 ; fi ; \
  429. for i in $(srcdir)/test/XPath/expr/* ; do \
  430. name=`basename $$i`; \
  431. if [ ! -d $$i ] ; then \
  432. if [ ! -f $(srcdir)/result/XPath/expr/$$name ] ; then \
  433. echo New test file $$name ; \
  434. $(CHECKER) $(top_builddir)/testXPath -f --expr $$i > $(srcdir)/result/XPath/expr/$$name ; \
  435. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  436. else \
  437. log=`$(CHECKER) $(top_builddir)/testXPath -f --expr $$i 2>&1 > result.$$name ; \
  438. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  439. diff $(srcdir)/result/XPath/expr/$$name result.$$name` ; \
  440. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  441. rm result.$$name ; \
  442. fi ; fi ; done ; \
  443. for i in $(srcdir)/test/XPath/docs/* ; do \
  444. if [ ! -d $$i ] ; then \
  445. doc=`basename $$i`; \
  446. for j in $(srcdir)/test/XPath/tests/$$doc* ; do \
  447. if [ ! -f $$j ] ; then continue ; fi ; \
  448. name=`basename $$j`; \
  449. if [ ! -d $$j ] ; then \
  450. if [ ! -f $(srcdir)/result/XPath/tests/$$name ] ; then \
  451. echo New test file $$name ; \
  452. $(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j > $(srcdir)/result/XPath/tests/$$name ; \
  453. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  454. else \
  455. log=`$(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j 2>&1 > result.$$name ; \
  456. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  457. diff $(srcdir)/result/XPath/tests/$$name result.$$name` ; \
  458. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  459. rm result.$$name ; \
  460. fi ; fi ; done ; fi ; done)
  461. XPtrtests : testXPath$(EXEEXT)
  462. @(echo > .memdump)
  463. @echo "## XPointer regression tests"
  464. -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \
  465. then echo Skipping debug not compiled in ; exit 0 ; fi ; \
  466. for i in $(srcdir)/test/XPath/docs/* ; do \
  467. if [ ! -d $$i ] ; then \
  468. doc=`basename $$i`; \
  469. for j in $(srcdir)/test/XPath/xptr/$$doc* ; do \
  470. if [ ! -f $$j ] ; then continue ; fi ; \
  471. name=`basename $$j`; \
  472. if [ ! -d $$j ] ; then \
  473. if [ ! -f $(srcdir)/result/XPath/xptr/$$name ] ; then \
  474. echo New test file $$name ; \
  475. $(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j > $(srcdir)/result/XPath/xptr/$$name ; \
  476. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  477. else \
  478. log=`$(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j 2>&1 > result.$$name ; \
  479. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  480. diff $(srcdir)/result/XPath/xptr/$$name result.$$name` ; \
  481. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  482. rm result.$$name ; \
  483. fi ; fi ; done ; fi ; done)
  484. XIncludetests : xmllint$(EXEEXT)
  485. @(echo > .memdump)
  486. @echo "## XInclude regression tests"
  487. -@(for i in $(srcdir)/test/XInclude/docs/* ; do \
  488. name=`basename $$i`; \
  489. if [ ! -d $$i ] ; then \
  490. if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \
  491. echo New test file $$name ; \
  492. $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \
  493. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  494. else \
  495. log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > result.$$name 2>error.$$name ; \
  496. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  497. diff $(srcdir)/result/XInclude/$$name result.$$name ; \
  498. diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \
  499. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  500. rm result.$$name error.$$name ; \
  501. fi ; fi ; done)
  502. -@(for i in $(srcdir)/test/XInclude/docs/* ; do \
  503. name=`basename $$i`; \
  504. if [ ! -d $$i ] ; then \
  505. if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \
  506. echo New test file $$name ; \
  507. $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \
  508. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  509. else \
  510. log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > result.$$name 2>error.$$name ; \
  511. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  512. diff $(srcdir)/result/XInclude/$$name result.$$name ; \
  513. diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \
  514. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  515. rm result.$$name error.$$name ; \
  516. fi ; fi ; done)
  517. @(echo > .memdump)
  518. @echo "## XInclude xmlReader regression tests"
  519. -@(for i in $(srcdir)/test/XInclude/docs/* ; do \
  520. name=`basename $$i`; \
  521. if [ ! -d $$i ] ; then \
  522. if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \
  523. echo New test file $$name ; \
  524. $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \
  525. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  526. else \
  527. log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \
  528. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  529. diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \
  530. diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \
  531. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  532. rm result.$$name error.$$name ; \
  533. fi ; fi ; done)
  534. -@(for i in $(srcdir)/test/XInclude/docs/* ; do \
  535. name=`basename $$i`; \
  536. if [ ! -d $$i ] ; then \
  537. if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \
  538. echo New test file $$name ; \
  539. $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \
  540. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  541. else \
  542. log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \
  543. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  544. diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \
  545. diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \
  546. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  547. rm result.$$name error.$$name ; \
  548. fi ; fi ; done)
  549. Scripttests : xmllint$(EXEEXT)
  550. @(echo > .memdump)
  551. @echo "## Scripts regression tests"
  552. @echo "## Some of the base computations may be different if srcdir != ."
  553. -@(for i in $(srcdir)/test/scripts/*.script ; do \
  554. name=`basename $$i .script`; \
  555. xml=$(srcdir)/test/scripts/`basename $$i .script`.xml; \
  556. if [ -f $$xml ] ; then \
  557. if [ ! -f $(srcdir)/result/scripts/$$name ] ; then \
  558. echo New test file $$name ; \
  559. $(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > $(srcdir)/result/scripts/$$name 2> $(srcdir)/result/scripts/$$name.err ; \
  560. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  561. else \
  562. log=`$(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > result.$$name 2> result.$$name.err ; \
  563. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  564. diff $(srcdir)/result/scripts/$$name result.$$name ; \
  565. diff $(srcdir)/result/scripts/$$name.err result.$$name.err` ; \
  566. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  567. rm result.$$name result.$$name.err ; \
  568. fi ; fi ; done)
  569. Catatests : xmlcatalog$(EXEEXT)
  570. @(echo > .memdump)
  571. @echo "## Catalog regression tests"
  572. -@(for i in $(srcdir)/test/catalogs/*.script ; do \
  573. name=`basename $$i .script`; \
  574. xml=$(srcdir)/test/catalogs/`basename $$i .script`.xml; \
  575. if [ -f $$xml ] ; then \
  576. if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
  577. echo New test file $$name ; \
  578. $(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > $(srcdir)/result/catalogs/$$name ; \
  579. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  580. else \
  581. log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > result.$$name ; \
  582. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  583. diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
  584. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  585. rm result.$$name ; \
  586. fi ; fi ; done)
  587. -@(for i in $(srcdir)/test/catalogs/*.script ; do \
  588. name=`basename $$i .script`; \
  589. sgml=$(srcdir)/test/catalogs/`basename $$i .script`.sgml; \
  590. if [ -f $$sgml ] ; then \
  591. if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
  592. echo New test file $$name ; \
  593. $(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > $(srcdir)/result/catalogs/$$name ; \
  594. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  595. else \
  596. log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \
  597. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  598. diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
  599. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  600. rm result.$$name ; \
  601. fi ; fi ; done)
  602. @echo "## Add and del operations on XML Catalogs"
  603. -@($(CHECKER) $(top_builddir)/xmlcatalog --create --noout $(srcdir)/result/catalogs/mycatalog; \
  604. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  605. $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid sysid $(srcdir)/result/catalogs/mycatalog; \
  606. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  607. $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid2 sysid2 $(srcdir)/result/catalogs/mycatalog; \
  608. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  609. $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid3 sysid3 $(srcdir)/result/catalogs/mycatalog; \
  610. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  611. diff result/catalogs/mycatalog.full $(srcdir)/result/catalogs/mycatalog; \
  612. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  613. $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid $(srcdir)/result/catalogs/mycatalog; \
  614. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  615. $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid3 $(srcdir)/result/catalogs/mycatalog; \
  616. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  617. $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid2 $(srcdir)/result/catalogs/mycatalog; \
  618. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  619. diff result/catalogs/mycatalog.empty $(srcdir)/result/catalogs/mycatalog; \
  620. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  621. rm -f $(srcdir)/result/catalogs/mycatalog)
  622. SVGtests : xmllint$(EXEEXT)
  623. @echo "## SVG parsing regression tests"
  624. -@(for i in $(srcdir)/test/SVG/* ; do \
  625. name=`basename $$i`; \
  626. if [ ! -d $$i ] ; then \
  627. if [ ! -f $(srcdir)/result/SVG/$$name ] ; then \
  628. echo New test file $$name ; \
  629. $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/SVG/$$name ; \
  630. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  631. else \
  632. echo Testing $$name ; \
  633. $(CHECKER) $(top_builddir)/xmllint $$i > result.$$name ; \
  634. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  635. diff $(srcdir)/result/SVG/$$name result.$$name ; \
  636. $(CHECKER) $(top_builddir)/xmllint result.$$name > result2.$$name ; \
  637. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  638. diff result.$$name result2.$$name ; \
  639. rm result.$$name result2.$$name ; \
  640. fi ; fi ; done)
  641. Threadtests : testThreads$(EXEEXT)
  642. @echo "## Threaded regression tests"
  643. -@($(CHECKER) $(top_builddir)/testThreads ; \
  644. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  645. exit 0)
  646. Readertests : xmllint$(EXEEXT)
  647. @(echo > .memdump)
  648. @echo "## Reader regression tests"
  649. -@(for i in $(srcdir)/test/* ; do \
  650. name=`basename $$i`; \
  651. if [ ! -d $$i ] ; then \
  652. if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \
  653. echo New test file $$name ; \
  654. $(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \
  655. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  656. else \
  657. log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
  658. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  659. diff $(srcdir)/result/$$name.rdr result.$$name` ; \
  660. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  661. rm result.$$name ; \
  662. fi ; fi ; done)
  663. @echo "## Reader on memory regression tests"
  664. -@(for i in $(srcdir)/test/* ; do \
  665. name=`basename $$i`; \
  666. if [ ! -d $$i ] ; then \
  667. if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \
  668. echo New test file $$name ; \
  669. $(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \
  670. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  671. else \
  672. log=`$(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
  673. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  674. diff $(srcdir)/result/$$name.rdr result.$$name` ; \
  675. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  676. rm result.$$name ; \
  677. fi ; fi ; done)
  678. @(echo > .memdump)
  679. @echo "## Walker regression tests"
  680. -@(for i in $(srcdir)/test/* ; do \
  681. name=`basename $$i`; \
  682. if [ ! -d $$i ] ; then \
  683. if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \
  684. echo New test file $$name ; \
  685. $(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \
  686. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  687. else \
  688. log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > result.$$name 2>/dev/null ; \
  689. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  690. diff $(srcdir)/result/$$name.rdr result.$$name` ; \
  691. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  692. rm result.$$name ; \
  693. fi ; fi ; done)
  694. @echo "## Reader entities substitution regression tests"
  695. -@(for i in $(srcdir)/test/* ; do \
  696. name=`basename $$i`; \
  697. if [ ! -d $$i ] ; then \
  698. if [ ! -f $(srcdir)/result/$$name.rde ] ; then \
  699. echo New test file $$name ; \
  700. $(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > $(srcdir)/result/$$name.rde 2>/dev/null ; \
  701. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  702. else \
  703. log=`$(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
  704. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  705. diff $(srcdir)/result/$$name.rde result.$$name` ; \
  706. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  707. rm result.$$name ; \
  708. fi ; fi ; done)
  709. SAXtests : testSAX$(EXEEXT)
  710. @(echo > .memdump)
  711. @echo "## SAX1 callbacks regression tests"
  712. -@(for i in $(srcdir)/test/* ; do \
  713. name=`basename $$i`; \
  714. if [ ! -d $$i ] ; then \
  715. if [ ! -f $(srcdir)/result/$$name.sax ] ; then \
  716. echo New test file $$name ; \
  717. $(CHECKER) $(top_builddir)/testSAX $$i > $(srcdir)/result/$$name.sax 2> /dev/null ; \
  718. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  719. else \
  720. log=`$(CHECKER) $(top_builddir)/testSAX $$i > result.$$name 2> /dev/null ; \
  721. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  722. diff $(srcdir)/result/$$name.sax result.$$name` ; \
  723. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  724. rm result.$$name ; \
  725. fi ; fi ; done)
  726. @echo "## SAX2 callbacks regression tests"
  727. -@(for i in $(srcdir)/test/* ; do \
  728. name=`basename $$i`; \
  729. if [ ! -d $$i ] ; then \
  730. if [ ! -f $(srcdir)/result/$$name.sax2 ] ; then \
  731. echo New test file $$name ; \
  732. $(CHECKER) $(top_builddir)/testSAX --sax2 $$i > $(srcdir)/result/$$name.sax2 2> /dev/null ; \
  733. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  734. else \
  735. log=`$(CHECKER) $(top_builddir)/testSAX --sax2 $$i > result.$$name 2> /dev/null ; \
  736. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  737. diff $(srcdir)/result/$$name.sax2 result.$$name` ; \
  738. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  739. rm result.$$name ; \
  740. fi ; fi ; done)
  741. Validtests : xmllint$(EXEEXT)
  742. @(echo > .memdump)
  743. @echo "## Valid documents regression tests"
  744. -@(for i in $(srcdir)/test/VCM/* ; do \
  745. name=`basename $$i`; \
  746. if [ ! -d $$i ] ; then \
  747. log=`$(CHECKER) $(top_builddir)/xmllint --valid --noout --nowarning $$i ; \
  748. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`;\
  749. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  750. fi ; done ; exit 0)
  751. @echo "## Validity checking regression tests"
  752. -@(for i in $(srcdir)/test/VC/* ; do \
  753. name=`basename $$i`; \
  754. if [ ! -d $$i ] ; then \
  755. if [ ! -f $(srcdir)/result/VC/$$name ] ; then \
  756. echo New test file $$name ; \
  757. $(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> $(srcdir)/result/VC/$$name ; \
  758. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  759. else \
  760. log=`$(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> result.$$name ; \
  761. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  762. diff $(srcdir)/result/VC/$$name result.$$name` ; \
  763. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  764. rm result.$$name ; \
  765. fi ; fi ; done)
  766. @echo "## General documents valid regression tests"
  767. -@(for i in $(srcdir)/test/valid/* ; do \
  768. name=`basename $$i`; \
  769. if [ ! -d $$i ] ; then \
  770. if [ ! -f $(srcdir)/result/valid/$$name ] ; then \
  771. echo New test file $$name ; \
  772. $(CHECKER) $(top_builddir)/xmllint --valid $$i > $(srcdir)/result/valid/$$name 2>$(srcdir)/result/valid/$$name.err ; \
  773. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  774. else \
  775. log=`$(CHECKER) $(top_builddir)/xmllint --valid $$i > result.$$name 2>error.$$name ; \
  776. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  777. diff $(srcdir)/result/valid/$$name result.$$name ; \
  778. diff $(srcdir)/result/valid/$$name.err error.$$name` ; \
  779. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  780. rm result.$$name error.$$name ; \
  781. fi ; fi ; done)
  782. Regexptests: testRegexp$(EXEEXT)
  783. @(echo > .memdump)
  784. @echo "## Regexp regression tests"
  785. -@(for i in $(srcdir)/test/regexp/* ; do \
  786. name=`basename $$i`; \
  787. if [ ! -d $$i ] ; then \
  788. if [ ! -f $(srcdir)/result/regexp/$$name ] ; then \
  789. echo New test file $$name ; \
  790. $(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name; \
  791. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  792. else \
  793. log=`$(CHECKER) $(top_builddir)/testRegexp -i $$i 2>&1 > result.$$name ; \
  794. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  795. diff $(srcdir)/result/regexp/$$name result.$$name` ; \
  796. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  797. rm result.$$name ; \
  798. fi ; fi ; done)
  799. @echo "## Formal expresssions regression tests"
  800. -@(for i in $(srcdir)/test/expr/* ; do \
  801. name=`basename $$i`; \
  802. if [ ! -d $$i ] ; then \
  803. if [ ! -f $(srcdir)/result/expr/$$name ] ; then \
  804. echo New test file $$name ; \
  805. $(CHECKER) $(top_builddir)/testRegexp --expr -i $$i > $(srcdir)/result/expr/$$name; \
  806. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  807. else \
  808. log=`$(CHECKER) $(top_builddir)/testRegexp --expr -i $$i 2>&1 > result.$$name ; \
  809. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  810. diff $(srcdir)/result/expr/$$name result.$$name` ; \
  811. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  812. rm result.$$name ; \
  813. fi ; fi ; done)
  814. Automatatests: testAutomata$(EXEEXT)
  815. @(echo > .memdump)
  816. @echo "## Automata regression tests"
  817. -@(for i in $(srcdir)/test/automata/* ; do \
  818. name=`basename $$i`; \
  819. if [ ! -d $$i ] ; then \
  820. if [ ! -f $(srcdir)/result/automata/$$name ] ; then \
  821. echo New test file $$name ; \
  822. $(CHECKER) $(top_builddir)/testAutomata $$i > $(srcdir)/result/automata/$$name; \
  823. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  824. else \
  825. log=`$(CHECKER) $(top_builddir)/testAutomata $$i 2>&1 > result.$$name ; \
  826. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  827. diff $(srcdir)/result/automata/$$name result.$$name` ; \
  828. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  829. rm result.$$name ; \
  830. fi ; fi ; done)
  831. dba100000.xml: dbgenattr.pl
  832. @echo "## generating dba100000.xml"
  833. @($(PERL) $(top_srcdir)/dbgenattr.pl 100000 > dba100000.xml)
  834. Timingtests: xmllint$(EXEEXT) dba100000.xml
  835. @echo "## Timing tests to try to detect performance"
  836. @echo "## as well a memory usage breakage when streaming"
  837. @echo "## 1/ using the file interface"
  838. @echo "## 2/ using the memory interface"
  839. @echo "## 3/ repeated DOM parsing"
  840. @echo "## 4/ repeated DOM validation"
  841. -@($(top_builddir)/xmllint --stream --timing dba100000.xml; \
  842. MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
  843. if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
  844. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  845. exit 0)
  846. -@($(top_builddir)/xmllint --stream --timing --memory dba100000.xml; \
  847. MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
  848. if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
  849. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  850. exit 0)
  851. -@($(top_builddir)/xmllint --noout --timing --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
  852. MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
  853. if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
  854. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  855. exit 0)
  856. VTimingtests: xmllint$(EXEEXT)
  857. -@($(top_builddir)/xmllint --noout --timing --valid --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
  858. MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
  859. if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
  860. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  861. exit 0)
  862. C14Ntests : testC14N$(EXEEXT)
  863. @echo "## C14N and XPath regression tests"
  864. -@(for m in with-comments without-comments 1-1-without-comments exc-without-comments ; do \
  865. for i in $(srcdir)/test/c14n/$$m/*.xml ; do \
  866. if [ ! -d $$i ] ; then \
  867. name=`basename $$i .xml`; \
  868. cmdline="$(CHECKER) $(top_builddir)/testC14N --$$m $$i"; \
  869. if [ -f $(srcdir)/test/c14n/$$m/$$name.xpath ] ; then \
  870. cmdline="$$cmdline $(srcdir)/test/c14n/$$m/$$name.xpath"; \
  871. if [ -f $(srcdir)/test/c14n/$$m/$$name.ns ] ; then \
  872. cmdline="$$cmdline '`cat $(srcdir)/test/c14n/$$m/$$name.ns`'"; \
  873. fi; \
  874. fi; \
  875. $$cmdline > $(srcdir)/test/c14n/test.tmp; \
  876. if [ $$? -eq 0 ]; then \
  877. diff $(srcdir)/result/c14n/$$m/$$name $(srcdir)/test/c14n/test.tmp; \
  878. if [ $$? -ne 0 ]; then \
  879. echo "Test $$m/$$name failed"; \
  880. cat $(srcdir)/test/c14n/test.tmp; \
  881. fi; \
  882. else \
  883. echo "C14N failed"; \
  884. fi; \
  885. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  886. fi; \
  887. rm -f $(srcdir)/test/c14n/test.tmp; \
  888. done; \
  889. done)
  890. Schemastests: testSchemas$(EXEEXT)
  891. @(echo > .memdump)
  892. @echo "## Schemas regression tests"
  893. -@(for i in $(srcdir)/test/schemas/*_*.xsd ; do \
  894. name=`basename $$i | sed 's+_.*++'`; \
  895. sno=`basename $$i | sed 's+.*_\(.*\).xsd+\1+'`; \
  896. for j in $(srcdir)/test/schemas/"$$name"_*.xml ; do \
  897. if [ -f $$j ] ; then \
  898. xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
  899. if [ ! -f $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" ]; \
  900. then \
  901. echo New test file "$$name"_"$$sno"_"$$xno" ; \
  902. $(CHECKER) $(top_builddir)/testSchemas $$i $$j \
  903. > $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \
  904. 2> $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err; \
  905. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  906. else \
  907. log=`$(CHECKER) $(top_builddir)/testSchemas $$i $$j \
  908. > res.$$name 2> err.$$name;\
  909. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  910. diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \
  911. res.$$name;\
  912. diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err \
  913. err.$$name;\
  914. grep Unimplemented err.$$name`; \
  915. if [ -n "$$log" ] ; then echo "$$name"_"$$sno"_"$$xno" result ; echo $$log ; fi ; \
  916. rm res.$$name err.$$name ; \
  917. fi ; fi ;\
  918. done; done)
  919. Relaxtests: xmllint$(EXEEXT)
  920. @(echo > .memdump)
  921. @echo "## Relax-NG regression tests"
  922. -@(for i in $(srcdir)/test/relaxng/*.rng ; do \
  923. name=`basename $$i | sed 's+\.rng++'`; \
  924. if [ ! -f $(srcdir)/result/relaxng/"$$name"_valid ] ; then \
  925. echo New schemas $$name ; \
  926. $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \
  927. > $(srcdir)/result/relaxng/"$$name"_valid \
  928. 2> $(srcdir)/result/relaxng/"$$name"_err; \
  929. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  930. else \
  931. log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \
  932. > res.$$name 2> err.$$name;\
  933. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  934. diff $(srcdir)/result/relaxng/"$$name"_valid \
  935. res.$$name;\
  936. diff $(srcdir)/result/relaxng/"$$name"_err \
  937. err.$$name | grep -v "error detected at";\
  938. grep Unimplemented err.$$name`; \
  939. if [ -n "$$log" ] ; then echo schemas $$name result ; echo $$log ; fi ; \
  940. rm res.$$name err.$$name ; \
  941. fi; \
  942. for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \
  943. if [ -f $$j ] ; then \
  944. xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
  945. if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \
  946. then \
  947. echo New test file "$$name"_"$$xno" ; \
  948. $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \
  949. > $(srcdir)/result/relaxng/"$$name"_"$$xno" \
  950. 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \
  951. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  952. else \
  953. log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \
  954. > res.$$name 2> err.$$name;\
  955. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  956. diff $(srcdir)/result/relaxng/"$$name"_"$$xno" \
  957. res.$$name;\
  958. diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \
  959. err.$$name | grep -v "error detected at";\
  960. grep Unimplemented err.$$name`; \
  961. if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \
  962. rm res.$$name err.$$name ; \
  963. fi ; fi ; \
  964. done; done)
  965. @echo "## Relax-NG streaming regression tests"
  966. -@(for i in $(srcdir)/test/relaxng/*.rng ; do \
  967. name=`basename $$i | sed 's+\.rng++'`; \
  968. for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \
  969. if [ -f $$j ] ; then \
  970. xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
  971. if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \
  972. then \
  973. echo New test file "$$name"_"$$xno" ; \
  974. $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \
  975. > $(srcdir)/result/relaxng/"$$name"_"$$xno" \
  976. 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \
  977. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  978. else \
  979. log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --stream --relaxng $$i $$j \
  980. > res.$$name 2> err.$$name;\
  981. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  982. diff $(srcdir)/result/relaxng/"$$name"_"$$xno" res.$$name;\
  983. if [ "$$name" != "tutor10_1" -a "$$name" != "tutor10_2" -a "$$name" != "tutor3_2" -a "$$name" != "307377" -a "$$name" != "tutor8_2" ] ; then \
  984. diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \
  985. err.$$name | grep -v "error detected at";\
  986. fi ; grep Unimplemented err.$$name`; \
  987. if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \
  988. rm res.$$name err.$$name ; \
  989. fi ; fi ; \
  990. done; done)
  991. Schematrontests: xmllint$(EXEEXT)
  992. @(echo > .memdump)
  993. @echo "## Schematron regression tests"
  994. -@(for i in $(srcdir)/test/schematron/*.sct ; do \
  995. name=`basename $$i | sed 's+\.sct++'`; \
  996. for j in $(srcdir)/test/schematron/"$$name"_*.xml ; do \
  997. if [ -f $$j ] ; then \
  998. xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
  999. if [ ! -f $(srcdir)/result/schematron/"$$name"_"$$xno" ]; \
  1000. then \
  1001. echo New test file "$$name"_"$$xno" ; \
  1002. $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
  1003. > $(srcdir)/result/schematron/"$$name"_"$$xno" \
  1004. 2> $(srcdir)/result/schematron/"$$name"_"$$xno".err; \
  1005. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  1006. else \
  1007. log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
  1008. > res.$$name 2> err.$$name;\
  1009. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  1010. diff $(srcdir)/result/schematron/"$$name"_"$$xno" \
  1011. res.$$name;\
  1012. diff $(srcdir)/result/schematron/"$$name"_"$$xno".err \
  1013. err.$$name | grep -v "error detected at";\
  1014. grep Unimplemented err.$$name`; \
  1015. if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \
  1016. rm res.$$name err.$$name ; \
  1017. fi ; fi ; \
  1018. done; done)
  1019. RelaxNGPythonTests:
  1020. @(if [ -x $(PYTHON) ] ; then \
  1021. PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH ; \
  1022. export PYTHONPATH; \
  1023. LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
  1024. export LD_LIBRARY_PATH; \
  1025. echo "## Relax-NG Python based test suite 1" ; \
  1026. $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite.py ; \
  1027. echo "## Relax-NG Python based test suite 2" ; \
  1028. $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite2.py ; \
  1029. fi)
  1030. SchemasPythonTests:
  1031. @(if [ -x $(PYTHON) ] ; then \
  1032. PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH; \
  1033. export PYTHONPATH; \
  1034. LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
  1035. export LD_LIBRARY_PATH; \
  1036. echo "## XML Schemas datatypes Python based test suite" ; \
  1037. echo "## It is normal to see 11 errors reported" ; \
  1038. $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \
  1039. fi)
  1040. @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" MAKEFLAGS+=--silent pytests ; fi)
  1041. Patterntests: xmllint$(EXEEXT)
  1042. @(echo > .memdump)
  1043. @echo "## Pattern regression tests"
  1044. -@(for i in $(srcdir)/test/pattern/*.pat ; do \
  1045. name=`basename $$i .pat`; \
  1046. if [ -f $(srcdir)/test/pattern/$$name.xml ] ; then \
  1047. if [ ! -f $(srcdir)/result/pattern/$$name ] ; then \
  1048. rm -f result.$$name ; \
  1049. echo New test file $$name ; \
  1050. for pat in `cat $$i` ; do \
  1051. $(CHECKER) $(top_builddir)/xmllint --walker --pattern $$pat $(srcdir)/test/pattern/$$name.xml >> $(srcdir)/result/pattern/$$name ; \
  1052. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  1053. done ;\
  1054. else \
  1055. rm -f result.$$name ; \
  1056. lst=`cat $$i` ; \
  1057. log=`for pat in $$lst ; do $(CHECKER) $(top_builddir)/xmllint --walker --pattern $$pat $(srcdir)/test/pattern/$$name.xml 2>&1 >> result.$$name ; \
  1058. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  1059. done ;\
  1060. diff $(srcdir)/result/pattern/$$name result.$$name` ; \
  1061. if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
  1062. rm result.$$name ; \
  1063. fi ; fi ; done ;)
  1064. ModuleTests: testModule$(EXEEXT) testdso.la
  1065. @echo "## Module tests"
  1066. @(./testModule$(EXEEXT))
  1067. cleanup:
  1068. -@(find . -name .\#\* -exec rm {} \;)
  1069. -@(find . -name \*.gcda -o *.gcno -exec rm {} \;)
  1070. -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm {} \;)
  1071. dist-hook: cleanup libxml2.spec
  1072. -cp libxml2.spec $(distdir)
  1073. (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn win32 macos vms VxWorks bakefile test result) | (cd $(distdir); tar xf -)
  1074. dist-source: distdir
  1075. $(AMTAR) -chof - --exclude Tests --exclude test --exclude result $(distdir) | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-sources+"`.tar.gz
  1076. dist-test: distdir
  1077. (mkdir -p $(distdir))
  1078. (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn xstc/Tests) | (cd $(distdir); tar xf -)
  1079. 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
  1080. @(rm -rf $(distdir)/xstc/Test)
  1081. cleantar:
  1082. @(rm -f libxml*.tar.gz COPYING.LIB)
  1083. rpm: cleanup cleantar
  1084. @(unset CDPATH ; $(MAKE) dist-source dist && rpmbuild -ta $(distdir).tar.gz)
  1085. ## We create xml2Conf.sh here and not from configure because we want
  1086. ## to get the paths expanded correctly. Macros like srcdir are given
  1087. ## the value NONE in configure if the user doesn't specify them (this
  1088. ## is an autoconf feature, not a bug).
  1089. xml2Conf.sh: xml2Conf.sh.in Makefile
  1090. ## Use sed and then mv to avoid problems if the user interrupts.
  1091. sed -e 's?\@XML_LIBDIR\@?$(XML_LIBDIR)?g' \
  1092. -e 's?\@XML_INCLUDEDIR\@?$(XML_INCLUDEDIR)?g' \
  1093. -e 's?\@VERSION\@?$(VERSION)?g' \
  1094. -e 's?\@XML_LIBS\@?$(XML_LIBS)?g' \
  1095. < $(srcdir)/xml2Conf.sh.in > xml2Conf.tmp \
  1096. && mv xml2Conf.tmp xml2Conf.sh
  1097. CLEANFILES=xml2Conf.sh *.gcda *.gcno
  1098. confexecdir=$(libdir)
  1099. confexec_DATA = xml2Conf.sh
  1100. CVS_EXTRA_DIST=
  1101. EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml2.spec \
  1102. libxml.m4 Copyright check-xml-test-suite.py gentest.py \
  1103. check-relaxng-test-suite.py check-relaxng-test-suite2.py \
  1104. check-xsddata-test-suite.py check-xinclude-test-suite.py \
  1105. example/Makefile.am example/gjobread.c example/gjobs.xml \
  1106. $(man_MANS) libxml-2.0.pc.in libxml-2.0-uninstalled.pc.in \
  1107. trionan.c trionan.h triostr.c triostr.h trio.c trio.h \
  1108. triop.h triodef.h libxml.h elfgcchack.h \
  1109. testThreadsWin32.c genUnicode.py TODO_SCHEMAS \
  1110. dbgen.pl dbgenattr.pl regressions.py regressions.xml \
  1111. README.tests Makefile.tests libxml2.syms \
  1112. $(CVS_EXTRA_DIST)
  1113. pkgconfigdir = $(libdir)/pkgconfig
  1114. pkgconfig_DATA = libxml-2.0.pc
  1115. #
  1116. # Install the tests program sources as examples
  1117. #
  1118. BASE_DIR=$(datadir)/doc
  1119. DOC_MODULE=libxml2-$(VERSION)
  1120. EXAMPLES_DIR=$(BASE_DIR)/$(DOC_MODULE)/examples
  1121. install-data-local:
  1122. $(mkinstalldirs) $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)
  1123. -@INSTALL@ -m 0644 $(srcdir)/Copyright $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)
  1124. $(mkinstalldirs) $(DESTDIR)$(EXAMPLES_DIR)
  1125. -@INSTALL@ -m 0644 $(srcdir)/xmllint.c $(DESTDIR)$(EXAMPLES_DIR)
  1126. -@INSTALL@ -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR)
  1127. -@INSTALL@ -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR)
  1128. -@INSTALL@ -m 0644 $(srcdir)/testXPath.c $(DESTDIR)$(EXAMPLES_DIR)
  1129. uninstall-local:
  1130. rm -f $(DESTDIR)$(EXAMPLES_DIR)/testXPath.c
  1131. rm -f $(DESTDIR)$(EXAMPLES_DIR)/testHTML.c
  1132. rm -f $(DESTDIR)$(EXAMPLES_DIR)/testSAX.c
  1133. rm -f $(DESTDIR)$(EXAMPLES_DIR)/xmllint.c
  1134. rm -rf $(DESTDIR)$(EXAMPLES_DIR)
  1135. rm -f $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)/Copyright
  1136. rm -rf $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)
  1137. tst: tst.c
  1138. $(CC) $(CFLAGS) -Iinclude -o tst tst.c .libs/libxml2.a -lpthread -lm -lz
  1139. sparse: clean
  1140. $(MAKE) CC=cgcc
  1141. #
  1142. # Coverage support, largely borrowed from libvirt
  1143. # Both binaries comes from the lcov package in Fedora
  1144. #
  1145. LCOV = /usr/bin/lcov
  1146. GENHTML = /usr/bin/genhtml
  1147. cov: clean-cov
  1148. if [ "`echo $(LDFLAGS) | grep coverage`" = "" ] ; then \
  1149. echo not configured with coverage; exit 1 ; fi
  1150. if [ ! -x $(LCOV) -o ! -x $(GENHTML) ] ; then \
  1151. echo Need $(LCOV) and $(GENHTML) excecutables; exit 1 ; fi
  1152. -@($(MAKE) check)
  1153. -@(./runsuite$(EXEEXT))
  1154. mkdir $(top_builddir)/coverage
  1155. $(LCOV) -c -o $(top_builddir)/coverage/libxml2.info.tmp -d $(top_srcdir)
  1156. $(LCOV) -r $(top_builddir)/coverage/libxml2.info.tmp -o $(top_builddir)/coverage/libxml2.info *usr*
  1157. rm $(top_builddir)/coverage/libxml2.info.tmp
  1158. $(GENHTML) -s -t "libxml2" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libxml2.info
  1159. echo "Coverage report is in $(top_builddir)/coverage/index.html"
  1160. clean-cov:
  1161. rm -rf $(top_builddir)/coverage