Friday, 13 March 2009

Testing Times

Half-pipe can now run either individual tests or the whole suite from the XProc Test Suite. There are currently two transforms xproc-tester.xsl and xproc-test-suite.xsl of which the latter imports the former.

One important point to note, the compiler implementation can, if it doesn't understand the pipeline it is processing, generate an invalid XSLT. This, by itself, is not the end of the world, but when Saxon attempts to compile and execute that transform it will throw an exception and without the ability to catch exceptions (I use SaxonB) there is no way to fail gracefully. Therefore, I read from the xproc-compiler.xsl transform which steps have been implemented and then only test those, all other step tests return a fail element with a message saying 'Not Supported'.

The end result of running the whole test suite is an XProc Test Suite report document that can then be uploaded to the website. Just for a bit more fun, and to keep any hard-code data out of the transforms, I think I put the project details into a Description of a Project (DOAP) document and pull the data from there when running the tests.

No comments:

Post a Comment