Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 1 | # |
| 2 | # Definition for the tests from W3C |
| 3 | # |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 4 | PYSCRIPTS=nist-test.py ms-test.py sun-test.py |
| 5 | TESTDIRS=msxsdtest nisttest suntest |
| 6 | TARBALL=XSTC-20020116.tar.gz |
| 7 | TARBALLURL=http://www.w3.org/2001/05/xmlschema-test-collection/$(TARBALL) |
| 8 | |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 9 | # |
| 10 | # The local data and scripts |
| 11 | # |
| 12 | EXTRA_DIST=xstc.py sun-test-def.xml ms-test-def.xml nist-test-def.xml \ |
| 13 | xstc-to-python.xsl |
| 14 | |
| 15 | # |
| 16 | # Nothing is done by make, only make tests and |
| 17 | # only if Python and Schemas are enabled. |
| 18 | # |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 19 | all: |
| 20 | |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 21 | # |
| 22 | # The python tests are generated via XSLT |
| 23 | # |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 24 | nist-test.py: nist-test-def.xml xstc-to-python.xsl |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 25 | -@(if [ -x $(XSLTPROC) ] ; then \ |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 26 | echo "Rebuilding script" $@ ; \ |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 27 | $(XSLTPROC) --nonet $(srcdir)/xstc-to-python.xsl \ |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 28 | $(srcdir)/nist-test-def.xml > $@ ; \ |
| 29 | chmod +x $@ ; fi ) |
| 30 | |
| 31 | ms-test.py: ms-test-def.xml xstc-to-python.xsl |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 32 | -@(if [ -x $(XSLTPROC) ] ; then \ |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 33 | echo "Rebuilding script" $@ ; \ |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 34 | $(XSLTPROC) --nonet $(srcdir)/xstc-to-python.xsl \ |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 35 | $(srcdir)/ms-test-def.xml > $@ ; \ |
| 36 | chmod +x $@ ; fi ) |
| 37 | |
| 38 | sun-test.py: sun-test-def.xml xstc-to-python.xsl |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 39 | -@(if [ -x $(XSLTPROC) ] ; then \ |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 40 | echo "Rebuilding script" $@ ; \ |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 41 | $(XSLTPROC) --nonet $(srcdir)/xstc-to-python.xsl \ |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 42 | $(srcdir)/sun-test-def.xml > $@ ; \ |
| 43 | chmod +x $@ ; fi ) |
| 44 | |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 45 | # |
| 46 | # Rule to load the test description and extract the informations |
| 47 | # |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 48 | $(TESTDIRS): |
| 49 | -@(if [ ! -f $(TARBALL) ] ; then \ |
| 50 | echo "Missing the test suite description, trying to fetch it" ;\ |
| 51 | if [ -x /usr/bin/wget ] ; then \ |
| 52 | wget $(TARBALLURL) ; \ |
| 53 | else echo "Dont' know how to fetch $(TARBALLURL)" ; fi ; fi) |
| 54 | -@(if [ -f $(TARBALL) ] ; then \ |
| 55 | echo -n "extracting tests directories..." ; \ |
| 56 | $(TAR) -xzf $(TARBALL) $(TESTDIRS) ; \ |
| 57 | echo "done" ; \ |
| 58 | fi); |
| 59 | |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 60 | # |
| 61 | # The actual test run if present. PYTHONPATH is updated to make sure |
| 62 | # we run the version from the loacl build and not preinstalled bindings |
| 63 | # |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 64 | pytests: $(PYSCRIPTS) $(TESTDIRS) |
| 65 | -@(if [ -x nist-test.py -a -d nisttest ] ; then \ |
Daniel Veillard | 2cdd2f3 | 2004-09-06 12:55:41 +0000 | [diff] [blame] | 66 | echo "## Running NIST Schemas tests"; \ |
William M. Brack | a22da29 | 2005-02-12 01:08:22 +0000 | [diff] [blame^] | 67 | PYTHONPATH="../python:../python/.libs:..:../libs:$$PYTHONPATH" ;\ |
Daniel Veillard | aa9a352 | 2004-09-06 13:20:05 +0000 | [diff] [blame] | 68 | export PYTHONPATH; \ |
William M. Brack | a22da29 | 2005-02-12 01:08:22 +0000 | [diff] [blame^] | 69 | LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ |
| 70 | export LD_LIBRARY_PATH; \ |
Daniel Veillard | f31187d | 2004-09-06 14:05:06 +0000 | [diff] [blame] | 71 | $(CHECKER) $(PYTHON) nist-test.py -s -b $(srcdir) ; fi) |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 72 | -@(if [ -x sun-test.py -a -d suntest ] ; then \ |
Daniel Veillard | 2cdd2f3 | 2004-09-06 12:55:41 +0000 | [diff] [blame] | 73 | echo "## Running Sun Schemas tests"; \ |
William M. Brack | a22da29 | 2005-02-12 01:08:22 +0000 | [diff] [blame^] | 74 | PYTHONPATH="../python:../python/.libs:..:../libs:$$PYTHONPATH" ;\ |
Daniel Veillard | aa9a352 | 2004-09-06 13:20:05 +0000 | [diff] [blame] | 75 | export PYTHONPATH; \ |
William M. Brack | a22da29 | 2005-02-12 01:08:22 +0000 | [diff] [blame^] | 76 | LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ |
| 77 | export LD_LIBRARY_PATH; \ |
Daniel Veillard | f31187d | 2004-09-06 14:05:06 +0000 | [diff] [blame] | 78 | $(CHECKER) $(PYTHON) sun-test.py -s -b $(srcdir) ; fi) |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 79 | -@(if [ -x ms-test.py -a -d msxsdtest ] ; then \ |
Daniel Veillard | 2cdd2f3 | 2004-09-06 12:55:41 +0000 | [diff] [blame] | 80 | echo "## Running Microsoft Schemas tests"; \ |
William M. Brack | a22da29 | 2005-02-12 01:08:22 +0000 | [diff] [blame^] | 81 | PYTHONPATH="../python:../python/.libs:..:../libs:$$PYTHONPATH" ;\ |
Daniel Veillard | aa9a352 | 2004-09-06 13:20:05 +0000 | [diff] [blame] | 82 | export PYTHONPATH; \ |
William M. Brack | a22da29 | 2005-02-12 01:08:22 +0000 | [diff] [blame^] | 83 | LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ |
| 84 | export LD_LIBRARY_PATH; \ |
Daniel Veillard | f31187d | 2004-09-06 14:05:06 +0000 | [diff] [blame] | 85 | $(CHECKER) $(PYTHON) ms-test.py -s -b $(srcdir) ; fi) |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 86 | |
| 87 | tests: |
| 88 | -@(if [ -x $(PYTHON) ] ; then \ |
| 89 | $(MAKE) MAKEFLAGS+=--silent pytests ; fi); |
| 90 | |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 91 | # |
| 92 | # Heavy, works well only on RHEL3 |
| 93 | # |
Daniel Veillard | f31187d | 2004-09-06 14:05:06 +0000 | [diff] [blame] | 94 | valgrind: |
| 95 | -@(if [ -x $(PYTHON) ] ; then \ |
| 96 | echo '## Running the regression tests under Valgrind' ; \ |
| 97 | $(MAKE) CHECKER='valgrind -q' MAKEFLAGS+=--silent pytests ; fi); |
| 98 | |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 99 | clean: |
Daniel Veillard | 2cdd2f3 | 2004-09-06 12:55:41 +0000 | [diff] [blame] | 100 | rm -f $(PYSCRIPTS) test.log |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 101 | |
| 102 | distclean: |
Daniel Veillard | 2cdd2f3 | 2004-09-06 12:55:41 +0000 | [diff] [blame] | 103 | rm -rf $(PYSCRIPTS) $(TESTDIRS) test.log |