DocBook testdocs
The DocBook SourceForge project maintains a set of test documents.
At the time of this writing, you have to check them out from the DocBook Subversion repository if you want to use them:
svn co \ https://docbook.svn.sourceforge.net/svnroot/docbook/trunk/testdocs \ testdocs
The testdocs checkout does not include a test definitions file (i.e., a 'testsuite.xml' file) that is needed by this module, so you need to make your own.
'make-testsuite.pl' in the testing module generates a usable 'testsuites.xml' that includes a '<testcase>' element for each XML file in subdirectories of the specified directory. Since testdocs currently includes some XML files that aren't DocBook files, some of the generated test cases will always fail; you can edit those out of the generated 'testsuite.xml', but they will be regenerated if you ever regenerate the 'testsuite.xml' after updating your testdocs checkout.
The DocBook testdocs need a stylesheet if they are to be formatted (which, in a nutshell, is the whole point of DocBook and the DocBook SourceForge project). There are two alternatives for specifying the stylesheet:
- If you are also testing FO documents in the same run, e.g., also
testing the xmlroff testsuite, then you need to specify the
stylesheet for each testcase by specifying it when running
'make-testsuite.pl':
perl ../testing/make-testsuite.pl \ --stylesheet \ http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl \ . > testsuite.xml - Alternatively, if you are testing only DocBook documents, you can
specify the DocBook stylesheet as the default stylesheet when
configuring testing:
perl ../testing/make-testsuite.pl . > testsuite.xml cd ../testing ./configure \ --with-default-stylesheet=http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xslThis could be useful if you want to test different versions of the DocBook stylesheets.
