Daniel Veillard | b1da40c | 2004-09-06 11:57:44 +0000 | [diff] [blame^] | 1 | PYSCRIPTS=nist-test.py ms-test.py sun-test.py |
| 2 | TESTDIRS=msxsdtest nisttest suntest |
| 3 | TARBALL=XSTC-20020116.tar.gz |
| 4 | TARBALLURL=http://www.w3.org/2001/05/xmlschema-test-collection/$(TARBALL) |
| 5 | |
| 6 | all: |
| 7 | |
| 8 | nist-test.py: nist-test-def.xml xstc-to-python.xsl |
| 9 | -@(if [ -x $(bindir)/xsltproc ] ; then \ |
| 10 | echo "Rebuilding script" $@ ; \ |
| 11 | $(bindir)/xsltproc --nonet $(srcdir)/xstc-to-python.xsl \ |
| 12 | $(srcdir)/nist-test-def.xml > $@ ; \ |
| 13 | chmod +x $@ ; fi ) |
| 14 | |
| 15 | ms-test.py: ms-test-def.xml xstc-to-python.xsl |
| 16 | -@(if [ -x $(bindir)/xsltproc ] ; then \ |
| 17 | echo "Rebuilding script" $@ ; \ |
| 18 | $(bindir)/xsltproc --nonet $(srcdir)/xstc-to-python.xsl \ |
| 19 | $(srcdir)/ms-test-def.xml > $@ ; \ |
| 20 | chmod +x $@ ; fi ) |
| 21 | |
| 22 | sun-test.py: sun-test-def.xml xstc-to-python.xsl |
| 23 | -@(if [ -x $(bindir)/xsltproc ] ; then \ |
| 24 | echo "Rebuilding script" $@ ; \ |
| 25 | $(bindir)/xsltproc --nonet $(srcdir)/xstc-to-python.xsl \ |
| 26 | $(srcdir)/sun-test-def.xml > $@ ; \ |
| 27 | chmod +x $@ ; fi ) |
| 28 | |
| 29 | $(TESTDIRS): |
| 30 | -@(if [ ! -f $(TARBALL) ] ; then \ |
| 31 | echo "Missing the test suite description, trying to fetch it" ;\ |
| 32 | if [ -x /usr/bin/wget ] ; then \ |
| 33 | wget $(TARBALLURL) ; \ |
| 34 | else echo "Dont' know how to fetch $(TARBALLURL)" ; fi ; fi) |
| 35 | -@(if [ -f $(TARBALL) ] ; then \ |
| 36 | echo -n "extracting tests directories..." ; \ |
| 37 | $(TAR) -xzf $(TARBALL) $(TESTDIRS) ; \ |
| 38 | echo "done" ; \ |
| 39 | fi); |
| 40 | |
| 41 | pytests: $(PYSCRIPTS) $(TESTDIRS) |
| 42 | -@(if [ -x nist-test.py -a -d nisttest ] ; then \ |
| 43 | echo "# Running NIST Schemas tests"; \ |
| 44 | ./nist-test.py -s ; fi) |
| 45 | -@(if [ -x sun-test.py -a -d suntest ] ; then \ |
| 46 | echo "# Running Sun Schemas tests"; \ |
| 47 | ./sun-test.py -s ; fi) |
| 48 | -@(if [ -x ms-test.py -a -d msxsdtest ] ; then \ |
| 49 | echo "# Running Microsoft Schemas tests"; \ |
| 50 | ./ms-test.py -s ; fi) |
| 51 | |
| 52 | tests: |
| 53 | -@(if [ -x $(PYTHON) ] ; then \ |
| 54 | $(MAKE) MAKEFLAGS+=--silent pytests ; fi); |
| 55 | |
| 56 | clean: |
| 57 | rm -f $(PYSCRIPTS) |
| 58 | |
| 59 | distclean: |
| 60 | rm -rf $(PYSCRIPTS) $(TESTDIRS) |