Makefile.am 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. #
  2. # Definition for the tests from W3C
  3. #
  4. PYSCRIPTS=nist-test.py ms-test.py sun-test.py
  5. TESTDIR=Tests
  6. TESTDIRS=$(TESTDIR)/msxsdtest $(TESTDIR)/suntest $(TESTDIR)/Datatypes
  7. TARBALL=xsts-2002-01-16.tar.gz
  8. TARBALL_2=xsts-2004-01-14.tar.gz
  9. TSNAME=xmlschema2002-01-16
  10. TSNAME_2=xmlschema2004-01-14
  11. TARBALLURL=http://www.w3.org/XML/2004/xml-schema-test-suite/$(TSNAME)/$(TARBALL)
  12. TARBALLURL_2=http://www.w3.org/XML/2004/xml-schema-test-suite/$(TSNAME_2)/$(TARBALL_2)
  13. MSTESTDEF=MSXMLSchema1-0-20020116.testSet
  14. SUNTESTDEF=SunXMLSchema1-0-20020116.testSet
  15. NISTTESTDEF=NISTXMLSchema1-0-20020116.testSet
  16. NISTTESTDEF_2=NISTXMLSchemaDatatypes.testSet
  17. #
  18. # The local data and scripts
  19. #
  20. EXTRA_DIST=xstc.py xstc-to-python.xsl
  21. #
  22. # Nothing is done by make, only make tests and
  23. # only if Python and Schemas are enabled.
  24. #
  25. all:
  26. #
  27. # Rule to load the test description and extract the informations
  28. #
  29. $(TESTDIRS) Tests/Metadata/$(NISTTESTDEF_2) Tests/Metadata/$(MSTTESTDEF) Tests/Metadata/$(SUNTESTDEF):
  30. -@(if [ ! -d Tests ] ; then \
  31. mkdir Tests ; \
  32. fi)
  33. -@(if [ ! -f $(TARBALL_2) ] ; then \
  34. if [ -f $(srcdir)/$(TARBALL_2) ] ; then \
  35. $(LN_S) $(srcdir)/$(TARBALL_2) $(TARBALL_2) ; else \
  36. echo "Missing the test suite description (2004-01-14), trying to fetch it" ;\
  37. if [ -x "$(WGET)" ] ; then \
  38. $(WGET) $(TARBALLURL_2) ; \
  39. else echo "Dont' know how to fetch $(TARBALLURL_2)" ; fi ; fi ; fi)
  40. -@(if [ -f $(TARBALL_2) ] ; then \
  41. echo -n "extracting test data (NIST)..." ; \
  42. $(TAR) -xzf $(TARBALL_2) --wildcards '*/Datatypes' '*/Metadata/$(NISTTESTDEF_2)' ; \
  43. echo "done" ; \
  44. fi)
  45. -@(if [ ! -f $(TARBALL) ] ; then \
  46. if [ -f $(srcdir)/$(TARBALL) ] ; then \
  47. $(LN_S) $(srcdir)/$(TARBALL) $(TARBALL) ; else \
  48. echo "Missing the test suite description (2002-01-16), trying to fetch it" ;\
  49. if [ -x "$(WGET)" ] ; then \
  50. $(WGET) $(TARBALLURL) ; \
  51. else echo "Dont' know how to fetch $(TARBALLURL)" ; fi ; fi ; fi)
  52. -@(if [ -f $(TARBALL) ] ; then \
  53. echo -n "extracting test data (Sun, Microsoft)..." ; \
  54. $(TAR) -C Tests -xzf $(TARBALL) --wildcards '*/suntest' '*/msxsdtest' '*/$(MSTESTDEF)' '*/$(SUNTESTDEF)' ; \
  55. if [ -d Tests/suntest ] ; then rm -r Tests/suntest ; fi ; \
  56. if [ -d Tests/msxsdtest ] ; then rm -r Tests/msxsdtest ; fi ; \
  57. mv Tests/xmlschema2002-01-16/* Tests ; \
  58. mv Tests/*.testSet Tests/Metadata ; \
  59. rm -r Tests/xmlschema2002-01-16 ; \
  60. echo "done" ; \
  61. fi)
  62. #
  63. # The python tests are generated via XSLT
  64. #
  65. nist-test.py: Tests/Metadata/$(NISTTESTDEF_2) xstc-to-python.xsl
  66. -@(if [ -x $(XSLTPROC) ] ; then \
  67. echo "Rebuilding script (NIST)" $@ ; \
  68. $(XSLTPROC) --nonet --stringparam vendor NIST-2 \
  69. $(srcdir)/xstc-to-python.xsl \
  70. $(srcdir)/Tests/Metadata/$(NISTTESTDEF_2) > $@ ; \
  71. chmod +x $@ ; fi )
  72. ms-test.py: Tests/Metadata/$(MSTTESTDEF) xstc-to-python.xsl
  73. -@(if [ -x $(XSLTPROC) ] ; then \
  74. echo "Rebuilding script (Microsoft)" $@ ; \
  75. $(XSLTPROC) --nonet --stringparam vendor MS \
  76. $(srcdir)/xstc-to-python.xsl \
  77. $(srcdir)/Tests/Metadata/$(MSTESTDEF) > $@ ; \
  78. chmod +x $@ ; fi )
  79. sun-test.py: Tests/Metadata/$(SUNTESTDEF) xstc-to-python.xsl
  80. -@(if [ -x $(XSLTPROC) ] ; then \
  81. echo "Rebuilding script (Sun)" $@ ; \
  82. $(XSLTPROC) --nonet --stringparam vendor SUN \
  83. $(srcdir)/xstc-to-python.xsl \
  84. $(srcdir)/Tests/Metadata/$(SUNTESTDEF) > $@ ; \
  85. chmod +x $@ ; fi )
  86. #
  87. # The actual test run if present. PYTHONPATH is updated to make sure
  88. # we run the version from the loacl build and not preinstalled bindings
  89. #
  90. pytests: $(PYSCRIPTS) $(TESTDIRS)
  91. -@(if [ -x nist-test.py -a -d $(TESTDIR)/Datatypes ] ; then \
  92. echo "## Running XML Schema tests (NIST)"; \
  93. PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\
  94. export PYTHONPATH; \
  95. LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
  96. export LD_LIBRARY_PATH; \
  97. $(CHECKER) $(PYTHON) nist-test.py -s -b $(srcdir) ; fi)
  98. -@(if [ -x sun-test.py -a -d $(TESTDIR)/suntest ] ; then \
  99. echo "## Running Schema tests (Sun)"; \
  100. PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\
  101. export PYTHONPATH; \
  102. LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
  103. export LD_LIBRARY_PATH; \
  104. $(CHECKER) $(PYTHON) sun-test.py -s -b $(srcdir) ; fi)
  105. -@(if [ -x ms-test.py -a -d $(TESTDIR)/msxsdtest ] ; then \
  106. echo "## Running Schema tests (Microsoft)"; \
  107. PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\
  108. export PYTHONPATH; \
  109. LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
  110. export LD_LIBRARY_PATH; \
  111. $(CHECKER) $(PYTHON) ms-test.py -s -b $(srcdir) ; fi)
  112. tests:
  113. -@(if [ -x $(PYTHON) ] ; then \
  114. $(MAKE) MAKEFLAGS+=--silent pytests ; fi);
  115. #
  116. # Heavy, works well only on RHEL3
  117. #
  118. valgrind:
  119. -@(if [ -x $(PYTHON) ] ; then \
  120. echo '## Running the regression tests under Valgrind' ; \
  121. $(MAKE) CHECKER='valgrind -q' MAKEFLAGS+=--silent pytests ; fi);
  122. CLEANFILES=$(PYSCRIPTS) test.log