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 |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 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 |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 17 | |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 18 | # |
| 19 | # The local data and scripts |
| 20 | # |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 21 | EXTRA_DIST=xstc.py xstc-to-python.xsl |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 22 | # |
| 23 | # Nothing is done by make, only make tests and |
| 24 | # only if Python and Schemas are enabled. |
| 25 | # |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 26 | all: |
| 27 | |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 28 | # |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 29 | # Rule to load the test description and extract the informations |
| 30 | # |
Kasimier T. Buchcik | d8e1044 | 2005-06-13 13:00:15 +0000 | [diff] [blame] | 31 | $(TESTDIRS) Tests/Metadata/$(NISTTESTDEF_2) Tests/Metadata/$(MSTTESTDEF) Tests/Metadata/$(SUNTESTDEF): |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 32 | -@(if [ ! -d Tests ] ; then \ |
| 33 | mkdir Tests ; \ |
| 34 | fi) |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 35 | -@(if [ ! -f $(TARBALL_2) ] ; then \ |
Daniel Veillard | 33a2de9 | 2006-10-11 08:33:22 +0000 | [diff] [blame] | 36 | if [ -f $(srcdir)/$(TARBALL_2) ] ; then \ |
| 37 | $(LN_S) $(srcdir)/$(TARBALL_2) $(TARBALL_2) ; else \ |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 38 | echo "Missing the test suite description (2004-01-14), trying to fetch it" ;\ |
Daniel Veillard | 33a2de9 | 2006-10-11 08:33:22 +0000 | [diff] [blame] | 39 | if [ -x "$(WGET)" ] ; then \ |
| 40 | $(WGET) $(TARBALLURL_2) ; \ |
| 41 | else echo "Dont' know how to fetch $(TARBALLURL_2)" ; fi ; fi ; fi) |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 42 | -@(if [ -f $(TARBALL_2) ] ; then \ |
| 43 | echo -n "extracting test data (NIST)..." ; \ |
Daniel Veillard | 3130fe9 | 2007-06-12 12:24:54 +0000 | [diff] [blame] | 44 | $(TAR) -xzf $(TARBALL_2) --wildcards '*/Datatypes' '*/Metadata/$(NISTTESTDEF_2)' ; \ |
Kasimier T. Buchcik | 34b9a9c | 2005-06-13 12:43:29 +0000 | [diff] [blame] | 45 | echo "done" ; \ |
| 46 | fi) |
| 47 | -@(if [ ! -f $(TARBALL) ] ; then \ |
Daniel Veillard | 33a2de9 | 2006-10-11 08:33:22 +0000 | [diff] [blame] | 48 | if [ -f $(srcdir)/$(TARBALL) ] ; then \ |
| 49 | $(LN_S) $(srcdir)/$(TARBALL) $(TARBALL) ; else \ |
Kasimier T. Buchcik | 34b9a9c | 2005-06-13 12:43:29 +0000 | [diff] [blame] | 50 | echo "Missing the test suite description (2002-01-16), trying to fetch it" ;\ |
Daniel Veillard | 33a2de9 | 2006-10-11 08:33:22 +0000 | [diff] [blame] | 51 | if [ -x "$(WGET)" ] ; then \ |
| 52 | $(WGET) $(TARBALLURL) ; \ |
| 53 | else echo "Dont' know how to fetch $(TARBALLURL)" ; fi ; fi ; fi) |
Kasimier T. Buchcik | 34b9a9c | 2005-06-13 12:43:29 +0000 | [diff] [blame] | 54 | -@(if [ -f $(TARBALL) ] ; then \ |
| 55 | echo -n "extracting test data (Sun, Microsoft)..." ; \ |
Daniel Veillard | 3130fe9 | 2007-06-12 12:24:54 +0000 | [diff] [blame] | 56 | $(TAR) -C Tests -xzf $(TARBALL) --wildcards '*/suntest' '*/msxsdtest' '*/$(MSTESTDEF)' '*/$(SUNTESTDEF)' ; \ |
Kasimier T. Buchcik | d8e1044 | 2005-06-13 13:00:15 +0000 | [diff] [blame] | 57 | if [ -d Tests/suntest ] ; then rm -r Tests/suntest ; fi ; \ |
| 58 | if [ -d Tests/msxsdtest ] ; then rm -r Tests/msxsdtest ; fi ; \ |
Kasimier T. Buchcik | 34b9a9c | 2005-06-13 12:43:29 +0000 | [diff] [blame] | 59 | mv Tests/xmlschema2002-01-16/* Tests ; \ |
| 60 | mv Tests/*.testSet Tests/Metadata ; \ |
| 61 | rm -r Tests/xmlschema2002-01-16 ; \ |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 62 | echo "done" ; \ |
| 63 | fi) |
| 64 | |
| 65 | # |
| 66 | # The python tests are generated via XSLT |
| 67 | # |
Kasimier T. Buchcik | d8e1044 | 2005-06-13 13:00:15 +0000 | [diff] [blame] | 68 | nist-test.py: Tests/Metadata/$(NISTTESTDEF_2) xstc-to-python.xsl |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 69 | -@(if [ -x $(XSLTPROC) ] ; then \ |
| 70 | echo "Rebuilding script (NIST)" $@ ; \ |
| 71 | $(XSLTPROC) --nonet --stringparam vendor NIST-2 \ |
| 72 | $(srcdir)/xstc-to-python.xsl \ |
Kasimier T. Buchcik | 34b9a9c | 2005-06-13 12:43:29 +0000 | [diff] [blame] | 73 | $(srcdir)/Tests/Metadata/$(NISTTESTDEF_2) > $@ ; \ |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 74 | chmod +x $@ ; fi ) |
| 75 | |
Kasimier T. Buchcik | d8e1044 | 2005-06-13 13:00:15 +0000 | [diff] [blame] | 76 | ms-test.py: Tests/Metadata/$(MSTTESTDEF) xstc-to-python.xsl |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 77 | -@(if [ -x $(XSLTPROC) ] ; then \ |
| 78 | echo "Rebuilding script (Microsoft)" $@ ; \ |
| 79 | $(XSLTPROC) --nonet --stringparam vendor MS \ |
| 80 | $(srcdir)/xstc-to-python.xsl \ |
Kasimier T. Buchcik | 34b9a9c | 2005-06-13 12:43:29 +0000 | [diff] [blame] | 81 | $(srcdir)/Tests/Metadata/$(MSTESTDEF) > $@ ; \ |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 82 | chmod +x $@ ; fi ) |
| 83 | |
Kasimier T. Buchcik | d8e1044 | 2005-06-13 13:00:15 +0000 | [diff] [blame] | 84 | sun-test.py: Tests/Metadata/$(SUNTESTDEF) xstc-to-python.xsl |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 85 | -@(if [ -x $(XSLTPROC) ] ; then \ |
| 86 | echo "Rebuilding script (Sun)" $@ ; \ |
| 87 | $(XSLTPROC) --nonet --stringparam vendor SUN \ |
| 88 | $(srcdir)/xstc-to-python.xsl \ |
Kasimier T. Buchcik | 34b9a9c | 2005-06-13 12:43:29 +0000 | [diff] [blame] | 89 | $(srcdir)/Tests/Metadata/$(SUNTESTDEF) > $@ ; \ |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 90 | chmod +x $@ ; fi ) |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 91 | |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 92 | # |
| 93 | # The actual test run if present. PYTHONPATH is updated to make sure |
| 94 | # we run the version from the loacl build and not preinstalled bindings |
| 95 | # |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 96 | pytests: $(PYSCRIPTS) $(TESTDIRS) |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 97 | -@(if [ -x nist-test.py -a -d $(TESTDIR)/Datatypes ] ; then \ |
| 98 | echo "## Running XML Schema tests (NIST)"; \ |
Daniel Veillard | 33a2de9 | 2006-10-11 08:33:22 +0000 | [diff] [blame] | 99 | PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\ |
Daniel Veillard | aa9a352 | 2004-09-06 13:20:05 +0000 | [diff] [blame] | 100 | export PYTHONPATH; \ |
William M. Brack | a22da29 | 2005-02-12 01:08:22 +0000 | [diff] [blame] | 101 | LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ |
| 102 | export LD_LIBRARY_PATH; \ |
Daniel Veillard | f31187d | 2004-09-06 14:05:06 +0000 | [diff] [blame] | 103 | $(CHECKER) $(PYTHON) nist-test.py -s -b $(srcdir) ; fi) |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 104 | -@(if [ -x sun-test.py -a -d $(TESTDIR)/suntest ] ; then \ |
| 105 | echo "## Running Schema tests (Sun)"; \ |
Daniel Veillard | 33a2de9 | 2006-10-11 08:33:22 +0000 | [diff] [blame] | 106 | PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\ |
Daniel Veillard | aa9a352 | 2004-09-06 13:20:05 +0000 | [diff] [blame] | 107 | export PYTHONPATH; \ |
William M. Brack | a22da29 | 2005-02-12 01:08:22 +0000 | [diff] [blame] | 108 | LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ |
| 109 | export LD_LIBRARY_PATH; \ |
Daniel Veillard | f31187d | 2004-09-06 14:05:06 +0000 | [diff] [blame] | 110 | $(CHECKER) $(PYTHON) sun-test.py -s -b $(srcdir) ; fi) |
Kasimier T. Buchcik | 1ace203 | 2005-06-08 17:15:58 +0000 | [diff] [blame] | 111 | -@(if [ -x ms-test.py -a -d $(TESTDIR)/msxsdtest ] ; then \ |
| 112 | echo "## Running Schema tests (Microsoft)"; \ |
Daniel Veillard | 33a2de9 | 2006-10-11 08:33:22 +0000 | [diff] [blame] | 113 | PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\ |
Daniel Veillard | aa9a352 | 2004-09-06 13:20:05 +0000 | [diff] [blame] | 114 | export PYTHONPATH; \ |
William M. Brack | a22da29 | 2005-02-12 01:08:22 +0000 | [diff] [blame] | 115 | LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ |
| 116 | export LD_LIBRARY_PATH; \ |
Daniel Veillard | f31187d | 2004-09-06 14:05:06 +0000 | [diff] [blame] | 117 | $(CHECKER) $(PYTHON) ms-test.py -s -b $(srcdir) ; fi) |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 118 | |
| 119 | tests: |
| 120 | -@(if [ -x $(PYTHON) ] ; then \ |
| 121 | $(MAKE) MAKEFLAGS+=--silent pytests ; fi); |
| 122 | |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 123 | # |
| 124 | # Heavy, works well only on RHEL3 |
| 125 | # |
Daniel Veillard | f31187d | 2004-09-06 14:05:06 +0000 | [diff] [blame] | 126 | valgrind: |
| 127 | -@(if [ -x $(PYTHON) ] ; then \ |
| 128 | echo '## Running the regression tests under Valgrind' ; \ |
Daniel Veillard | cb4284e | 2007-04-25 13:55:20 +0000 | [diff] [blame] | 129 | $(MAKE) CHECKER='valgrind -q' MAKEFLAGS+=--silent pytests ; fi); |
Daniel Veillard | f31187d | 2004-09-06 14:05:06 +0000 | [diff] [blame] | 130 | |
Daniel Veillard | ff8b541 | 2008-04-03 05:41:28 +0000 | [diff] [blame] | 131 | CLEANFILES=$(PYSCRIPTS) test.log |
Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame] | 132 | |