Skip to content
Sandro edited this page Jan 10, 2016 · 5 revisions

In order to run the tests the XSpec test suite is transformed into an XSLT stylesheet which imports the stylesheet being tested. Running this stylesheet results in an XML document that holds the results which is then transformed into an HTML report. The two stylesheets involved in this process are:

Two scripts are provided that will perform this pipeline for you:

Note that you will have to edit each script to match the location of Saxon on your system. Make sure that you follow the installation instructions for Mac/Linux or Windows before running the script. To run the batch/shell scripts, run the following command from the xspec root directory.

For Mac/Linux:

bin/xspec.sh my-tests.xspec

For Windows:

bin\xspec.bat my-tests.xspec

If you prefer, you can run XSpec with Ant and Maven.

You can also use XProc for which you need to use the harness corresponding to your target processor and language. The target processor is the processor to run the tests (e.g. BaseX, eXist, MarkLogic, Saxon, or Zorba) and the target language is XSLT or XQuery. For instance, saxon-xslt-harness.xproc runs XSLT test suites using Saxon and ml-xquery-harness.xproc sends them to MarkLogic in order to be evaluated. For example, to run XSpec via XProc using Saxon:

java com.xmlcalabash.drivers.Main -i source=my-tests.xspec saxon-xslt-harness.xproc

XSpec is also integrated out-of-the-box in Oxygen.