blob: 82de1ef6be777035fd05bdfe18c368e90e01d19a [file] [log] [blame]
Daniel Veillard06500c82004-09-07 09:12:44 +00001#
2# Definition for the tests from W3C
3#
Daniel Veillardb1da40c2004-09-06 11:57:44 +00004PYSCRIPTS=nist-test.py ms-test.py sun-test.py
5TESTDIRS=msxsdtest nisttest suntest
6TARBALL=XSTC-20020116.tar.gz
7TARBALLURL=http://www.w3.org/2001/05/xmlschema-test-collection/$(TARBALL)
8
Daniel Veillard06500c82004-09-07 09:12:44 +00009#
10# The local data and scripts
11#
12EXTRA_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 Veillardb1da40c2004-09-06 11:57:44 +000019all:
20
Daniel Veillard06500c82004-09-07 09:12:44 +000021#
22# The python tests are generated via XSLT
23#
Daniel Veillardb1da40c2004-09-06 11:57:44 +000024nist-test.py: nist-test-def.xml xstc-to-python.xsl
Daniel Veillard06500c82004-09-07 09:12:44 +000025 -@(if [ -x $(XSLTPROC) ] ; then \
Daniel Veillardb1da40c2004-09-06 11:57:44 +000026 echo "Rebuilding script" $@ ; \
Daniel Veillard06500c82004-09-07 09:12:44 +000027 $(XSLTPROC) --nonet $(srcdir)/xstc-to-python.xsl \
Daniel Veillardb1da40c2004-09-06 11:57:44 +000028 $(srcdir)/nist-test-def.xml > $@ ; \
29 chmod +x $@ ; fi )
30
31ms-test.py: ms-test-def.xml xstc-to-python.xsl
Daniel Veillard06500c82004-09-07 09:12:44 +000032 -@(if [ -x $(XSLTPROC) ] ; then \
Daniel Veillardb1da40c2004-09-06 11:57:44 +000033 echo "Rebuilding script" $@ ; \
Daniel Veillard06500c82004-09-07 09:12:44 +000034 $(XSLTPROC) --nonet $(srcdir)/xstc-to-python.xsl \
Daniel Veillardb1da40c2004-09-06 11:57:44 +000035 $(srcdir)/ms-test-def.xml > $@ ; \
36 chmod +x $@ ; fi )
37
38sun-test.py: sun-test-def.xml xstc-to-python.xsl
Daniel Veillard06500c82004-09-07 09:12:44 +000039 -@(if [ -x $(XSLTPROC) ] ; then \
Daniel Veillardb1da40c2004-09-06 11:57:44 +000040 echo "Rebuilding script" $@ ; \
Daniel Veillard06500c82004-09-07 09:12:44 +000041 $(XSLTPROC) --nonet $(srcdir)/xstc-to-python.xsl \
Daniel Veillardb1da40c2004-09-06 11:57:44 +000042 $(srcdir)/sun-test-def.xml > $@ ; \
43 chmod +x $@ ; fi )
44
Daniel Veillard06500c82004-09-07 09:12:44 +000045#
46# Rule to load the test description and extract the informations
47#
Daniel Veillardb1da40c2004-09-06 11:57:44 +000048$(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 Veillard06500c82004-09-07 09:12:44 +000060#
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 Veillardb1da40c2004-09-06 11:57:44 +000064pytests: $(PYSCRIPTS) $(TESTDIRS)
65 -@(if [ -x nist-test.py -a -d nisttest ] ; then \
Daniel Veillard2cdd2f32004-09-06 12:55:41 +000066 echo "## Running NIST Schemas tests"; \
William M. Bracka22da292005-02-12 01:08:22 +000067 PYTHONPATH="../python:../python/.libs:..:../libs:$$PYTHONPATH" ;\
Daniel Veillardaa9a3522004-09-06 13:20:05 +000068 export PYTHONPATH; \
William M. Bracka22da292005-02-12 01:08:22 +000069 LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
70 export LD_LIBRARY_PATH; \
Daniel Veillardf31187d2004-09-06 14:05:06 +000071 $(CHECKER) $(PYTHON) nist-test.py -s -b $(srcdir) ; fi)
Daniel Veillardb1da40c2004-09-06 11:57:44 +000072 -@(if [ -x sun-test.py -a -d suntest ] ; then \
Daniel Veillard2cdd2f32004-09-06 12:55:41 +000073 echo "## Running Sun Schemas tests"; \
William M. Bracka22da292005-02-12 01:08:22 +000074 PYTHONPATH="../python:../python/.libs:..:../libs:$$PYTHONPATH" ;\
Daniel Veillardaa9a3522004-09-06 13:20:05 +000075 export PYTHONPATH; \
William M. Bracka22da292005-02-12 01:08:22 +000076 LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
77 export LD_LIBRARY_PATH; \
Daniel Veillardf31187d2004-09-06 14:05:06 +000078 $(CHECKER) $(PYTHON) sun-test.py -s -b $(srcdir) ; fi)
Daniel Veillardb1da40c2004-09-06 11:57:44 +000079 -@(if [ -x ms-test.py -a -d msxsdtest ] ; then \
Daniel Veillard2cdd2f32004-09-06 12:55:41 +000080 echo "## Running Microsoft Schemas tests"; \
William M. Bracka22da292005-02-12 01:08:22 +000081 PYTHONPATH="../python:../python/.libs:..:../libs:$$PYTHONPATH" ;\
Daniel Veillardaa9a3522004-09-06 13:20:05 +000082 export PYTHONPATH; \
William M. Bracka22da292005-02-12 01:08:22 +000083 LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
84 export LD_LIBRARY_PATH; \
Daniel Veillardf31187d2004-09-06 14:05:06 +000085 $(CHECKER) $(PYTHON) ms-test.py -s -b $(srcdir) ; fi)
Daniel Veillardb1da40c2004-09-06 11:57:44 +000086
87tests:
88 -@(if [ -x $(PYTHON) ] ; then \
89 $(MAKE) MAKEFLAGS+=--silent pytests ; fi);
90
Daniel Veillard06500c82004-09-07 09:12:44 +000091#
92# Heavy, works well only on RHEL3
93#
Daniel Veillardf31187d2004-09-06 14:05:06 +000094valgrind:
95 -@(if [ -x $(PYTHON) ] ; then \
96 echo '## Running the regression tests under Valgrind' ; \
97 $(MAKE) CHECKER='valgrind -q' MAKEFLAGS+=--silent pytests ; fi);
98
Daniel Veillardb1da40c2004-09-06 11:57:44 +000099clean:
Daniel Veillard2cdd2f32004-09-06 12:55:41 +0000100 rm -f $(PYSCRIPTS) test.log
Daniel Veillardb1da40c2004-09-06 11:57:44 +0000101
102distclean:
Daniel Veillard2cdd2f32004-09-06 12:55:41 +0000103 rm -rf $(PYSCRIPTS) $(TESTDIRS) test.log