2004-09-07 13:12:44 +04:00
#
# Definition for the tests from W3C
#
2004-09-06 15:57:44 +04:00
PYSCRIPTS = nist-test.py ms-test.py sun-test.py
TESTDIRS = msxsdtest nisttest suntest
TARBALL = XSTC-20020116.tar.gz
TARBALLURL = http://www.w3.org/2001/05/xmlschema-test-collection/$( TARBALL)
2004-09-07 13:12:44 +04:00
#
# The local data and scripts
#
EXTRA_DIST = xstc.py sun-test-def.xml ms-test-def.xml nist-test-def.xml \
xstc-to-python.xsl
#
# Nothing is done by make, only make tests and
# only if Python and Schemas are enabled.
#
2004-09-06 15:57:44 +04:00
all :
2004-09-07 13:12:44 +04:00
#
# The python tests are generated via XSLT
#
2004-09-06 15:57:44 +04:00
nist-test.py : nist -test -def .xml xstc -to -python .xsl
2004-09-07 13:12:44 +04:00
-@( if [ -x $( XSLTPROC) ] ; then \
2004-09-06 15:57:44 +04:00
echo "Rebuilding script" $@ ; \
2004-09-07 13:12:44 +04:00
$( XSLTPROC) --nonet $( srcdir) /xstc-to-python.xsl \
2004-09-06 15:57:44 +04:00
$( srcdir) /nist-test-def.xml > $@ ; \
chmod +x $@ ; fi )
ms-test.py : ms -test -def .xml xstc -to -python .xsl
2004-09-07 13:12:44 +04:00
-@( if [ -x $( XSLTPROC) ] ; then \
2004-09-06 15:57:44 +04:00
echo "Rebuilding script" $@ ; \
2004-09-07 13:12:44 +04:00
$( XSLTPROC) --nonet $( srcdir) /xstc-to-python.xsl \
2004-09-06 15:57:44 +04:00
$( srcdir) /ms-test-def.xml > $@ ; \
chmod +x $@ ; fi )
sun-test.py : sun -test -def .xml xstc -to -python .xsl
2004-09-07 13:12:44 +04:00
-@( if [ -x $( XSLTPROC) ] ; then \
2004-09-06 15:57:44 +04:00
echo "Rebuilding script" $@ ; \
2004-09-07 13:12:44 +04:00
$( XSLTPROC) --nonet $( srcdir) /xstc-to-python.xsl \
2004-09-06 15:57:44 +04:00
$( srcdir) /sun-test-def.xml > $@ ; \
chmod +x $@ ; fi )
2004-09-07 13:12:44 +04:00
#
# Rule to load the test description and extract the informations
#
2004-09-06 15:57:44 +04:00
$(TESTDIRS) :
-@( if [ ! -f $( TARBALL) ] ; then \
echo "Missing the test suite description, trying to fetch it" ; \
if [ -x /usr/bin/wget ] ; then \
wget $( TARBALLURL) ; \
else echo " Dont' know how to fetch $( TARBALLURL) " ; fi ; fi )
-@( if [ -f $( TARBALL) ] ; then \
echo -n "extracting tests directories..." ; \
$( TAR) -xzf $( TARBALL) $( TESTDIRS) ; \
echo "done" ; \
fi ) ;
2005-04-02 14:28:13 +04:00
-@( if [ -x fixup-tests.py ] ; then \
chmod -R u+w msxsdtest; \
echo "## Microsoft tests fixups" ; \
PYTHONPATH = " ../python:../python/.libs:..:../libs: $$ PYTHONPATH " ; \
export PYTHONPATH; \
LD_LIBRARY_PATH = " $( top_builddir) /.libs: $$ LD_LIBRARY_PATH " ; \
$( PYTHON) fixup-tests.py ; fi )
2004-09-06 15:57:44 +04:00
2004-09-07 13:12:44 +04:00
#
# The actual test run if present. PYTHONPATH is updated to make sure
# we run the version from the loacl build and not preinstalled bindings
#
2004-09-06 15:57:44 +04:00
pytests : $( PYSCRIPTS ) $( TESTDIRS )
-@( if [ -x nist-test.py -a -d nisttest ] ; then \
2004-09-06 16:55:41 +04:00
echo "## Running NIST Schemas tests" ; \
2005-02-12 04:08:22 +03:00
PYTHONPATH = " ../python:../python/.libs:..:../libs: $$ PYTHONPATH " ; \
2004-09-06 17:20:05 +04:00
export PYTHONPATH; \
2005-02-12 04:08:22 +03:00
LD_LIBRARY_PATH = " $( top_builddir) /.libs: $$ LD_LIBRARY_PATH " ; \
export LD_LIBRARY_PATH; \
2004-09-06 18:05:06 +04:00
$( CHECKER) $( PYTHON) nist-test.py -s -b $( srcdir) ; fi )
2004-09-06 15:57:44 +04:00
-@( if [ -x sun-test.py -a -d suntest ] ; then \
2004-09-06 16:55:41 +04:00
echo "## Running Sun Schemas tests" ; \
2005-02-12 04:08:22 +03:00
PYTHONPATH = " ../python:../python/.libs:..:../libs: $$ PYTHONPATH " ; \
2004-09-06 17:20:05 +04:00
export PYTHONPATH; \
2005-02-12 04:08:22 +03:00
LD_LIBRARY_PATH = " $( top_builddir) /.libs: $$ LD_LIBRARY_PATH " ; \
export LD_LIBRARY_PATH; \
2004-09-06 18:05:06 +04:00
$( CHECKER) $( PYTHON) sun-test.py -s -b $( srcdir) ; fi )
2004-09-06 15:57:44 +04:00
-@( if [ -x ms-test.py -a -d msxsdtest ] ; then \
2004-09-06 16:55:41 +04:00
echo "## Running Microsoft Schemas tests" ; \
2005-02-12 04:08:22 +03:00
PYTHONPATH = " ../python:../python/.libs:..:../libs: $$ PYTHONPATH " ; \
2004-09-06 17:20:05 +04:00
export PYTHONPATH; \
2005-02-12 04:08:22 +03:00
LD_LIBRARY_PATH = " $( top_builddir) /.libs: $$ LD_LIBRARY_PATH " ; \
export LD_LIBRARY_PATH; \
2004-09-06 18:05:06 +04:00
$( CHECKER) $( PYTHON) ms-test.py -s -b $( srcdir) ; fi )
2004-09-06 15:57:44 +04:00
tests :
-@( if [ -x $( PYTHON) ] ; then \
$( MAKE) MAKEFLAGS += --silent pytests ; fi ) ;
2004-09-07 13:12:44 +04:00
#
# Heavy, works well only on RHEL3
#
2004-09-06 18:05:06 +04:00
valgrind :
-@( if [ -x $( PYTHON) ] ; then \
echo '## Running the regression tests under Valgrind' ; \
2005-03-02 13:47:41 +03:00
$( MAKE) CHECKER = 'valgrind' MAKEFLAGS += --silent pytests ; fi ) ;
2004-09-06 18:05:06 +04:00
2004-09-06 15:57:44 +04:00
clean :
2004-09-06 16:55:41 +04:00
rm -f $( PYSCRIPTS) test.log
2004-09-06 15:57:44 +04:00
distclean :
2004-09-06 16:55:41 +04:00
rm -rf $( PYSCRIPTS) $( TESTDIRS) test.log