xmlroff Testing Module

This module serves multiple purposes for the xmlroff XSL formatter:

  • Comparing results between different versions of xmlroff
  • Comparing results between xmlroff’s different output formats
  • Comparing xmlroff output to files produced another way, e.g., from a different formatter – FO or otherwise

The testing module uses a combination of Makefile, Perl, and commonly available utilities to:

  • Run an XSL formatter on one or more test suites conforming to the format originally defined by the W3C XSL FO subgroup for XSL 1.0 Candidate Recommendation testing. The test definition for a single test is shown below:
    <test id="expression1" fo="multiple" xml=""
    results="inherited-property-value.pdf">Use inherited-property-value()
    in expressions for font-size property, including using function with
    property other than font-size and using as part of a larger expression.</test>
  • Rasterise the PDF or PostScript? output
  • Compare the rasterised output against a reference
  • Produce a report summarising all tests and an individual report for each test

xmlroff summary report. Figure 1 – xmlroff test summary report

xmlroff individual report. Figure 2 – xmlroff individual test report (click on figure to view full-size)

  • Produce a “stereo” image combining the result and reference for any page that is different from its reference version

Stereo detail. Figure 3 – Detail of “stereo” comparison, where the red channel is from the current result and the blue channel is from the reference

When the reports are served by a web server, the record of the test results – which also conforms to the format defined by the W3C XSL FO subgroup – can be updated to indicate whether the result agrees with the expected result or to add a comment about the test result. The test result for the example is shown below:

<testresult id="expression1" results="expression1.pdf" agreement="full"
   specproblem="no" testproblem="no"/>

The testing module also includes utilities to convert DocBook? test documents and FOP layout engine tests to W3C format testsuites.