• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..05-Jan-2019-

.gitignoreH A D05-Jan-2019198 2120

AUTHORSH A D05-Jan-201916 21

COPYINGH A D05-Jan-20191.6 KiB3327

ChangeLogH A D05-Jan-20190

ChangeLog.pre-0.5H A D05-Jan-201912.8 KiB456269

ChangeLog.pre-0.6H A D05-Jan-201912.4 KiB412320

INSTALLH A D05-Jan-2019177 53

Makefile.amH A D05-Jan-20193.7 KiB133102

MyContentParams.pmH A D05-Jan-2019286 158

MyEventLog.pmH A D05-Jan-2019239 158

MyWebLog.pmH A D05-Jan-2019242 158

NEWSH A D05-Jan-20193.2 KiB10672

READMEH A D05-Jan-201928.2 KiB918605

TestCGI.pmH A D05-Jan-201913.4 KiB549462

TestHTTPReq.pmH A D05-Jan-20191.7 KiB7359

accept-all.shH A D05-Jan-2019211 1110

autogen.shH A D05-Jan-20191.4 KiB6446

cairo-pdf-results.xmlH A D05-Jan-201959.7 KiB523513

cairo-ps-results.xmlH A D05-Jan-201957 KiB511500

common.xslH A D05-Jan-201916.2 KiB433333

configure.acH A D05-Jan-201921.5 KiB720657

coverage.xslH A D05-Jan-20196.4 KiB173146

docbook-testdocs.confH A D05-Jan-2019525 196

dotests.plH A D05-Jan-20195.3 KiB21694

h2pl.plH A D05-Jan-20192 KiB8853

h2xsl.plH A D05-Jan-20192.3 KiB9459

identity.xslH A D05-Jan-2019321 1410

make-fop-testsuite.plH A D05-Jan-20194.1 KiB178118

make-success-report.shH A D05-Jan-2019111 64

make-testsuite.plH A D05-Jan-20193.8 KiB167108

png+ref2stereo.plH A D05-Jan-20195.1 KiB182128

regenerate-testsuccess.plH A D05-Jan-20191.2 KiB4828

regions-cairo-pdf-results.xmlH A D05-Jan-201960.9 KiB542532

results-doc.xslH A D05-Jan-201921.3 KiB550526

results-xml.xslH A D05-Jan-20193.6 KiB11088

style.css.inH A D05-Jan-20191.9 KiB9059

test2makefile.xslH A D05-Jan-201913.7 KiB369282

test2sh.xslH A D05-Jan-20198.8 KiB237182

testing-server.plH A D05-Jan-20192.3 KiB9272

testing.conf.inH A D05-Jan-2019386 1815

testresults.xmlH A D05-Jan-201960.7 KiB545535

testresults.xslH A D05-Jan-20191.4 KiB3823

testsuccess.plH A D05-Jan-20195.2 KiB178125

testsuccess.xslH A D05-Jan-201920.6 KiB583512

testsuites.xmlH A D05-Jan-2019177 63

testsuites2testresults.xslH A D05-Jan-20197.4 KiB218184

threaded.plH A D05-Jan-20191.9 KiB6844

update-result.xslH A D05-Jan-20193.9 KiB11697

update-results-xml.xslH A D05-Jan-20194.4 KiB136114

update-results.plH A D05-Jan-20199.4 KiB385310

xmlroff-testing-cairo-pdf.confH A D05-Jan-2019677 208

xmlroff-testing-cairo-ps.confH A D05-Jan-2019673 208

xmlroff-testing.confH A D05-Jan-2019637 208

README

1This is the framework of scripts and stylesheets for running any XSL
2formatter on a set of test files and working with the test results.
3
4The default configuration works with the xmlroff XSL Formatter.
5
6This is part of the xmlroff XSL Formatter project.
7
8-----------------------------------------------------------------------
9xmlroff is a fast, free, high-quality, multi-platform XSL formatter
10that aims to excel at DocBook formatting and that integrates easily
11with other programs and with scripting languages.
12
13The xmlroff XSL Formatter is a library -- libfo -- and a command-line
14program -- xmlroff -- for formatting XML according to the XSL 1.0
15Recommendation.
16
17See http://xmlroff.org/.
18-----------------------------------------------------------------------
19
20The version numbers of 'testing' releases are the same as the version
21of xmlroff that is current at the time of the 'testing' release.
22However, any version of this package may be used with any version of
23xmlroff, although using the newest 'testing' version is recommended
24since new versions tend to have bug fixes and ease of use improvements
25and, occasionally, better documentation.
26
271. Testing xmlroff
282. Requirements
293. Before you begin
304. Running the tests
315. Working with the results
326. Bundling the test results
337. When the test suite changes
348. Setting up a web server for updating results
359. Testing an alternative XSL processor
3610. DocBook testdocs
3711. FOP "layoutengine" Tests
3812. Setting defaults in the test results file
3913. Gory details
4014. License
41
42
431. Testing xmlroff
44==================
45
46xmlroff testing uses:
47
48 - Test cases from the XSL 1.0 CR test suite, NIST, and xmlroff
49
50   See the xmlroff 'testsuite' package and
51   http://www.w3.org/Style/XSL/TestSuite/.
52
53 - XSLT stylesheet for making shell scripts to run xmlroff on the test
54   cases
55
56 - Perl scripts for running the test scripts and diffing the outputs
57
58 - XSLT stylesheets for making summary and individual test result HTML
59   files
60
61 - Perl CGI script and XSLT stylesheet for optionally updating test
62   result HTML files
63
64
652. Requirements
66===============
67
68Testing xmlroff requires:
69
70 - Autotools
71
72 - Perl
73
74 - ImageMagick
75
76 - xsltproc
77
78
793. Before you begin
80===================
81
821. Download and install the xmlroff 'testsuite' package from
83   http://xmlroff.org/ or clone the git repository at
84   https://github.com/MenteaXML/xmlroff.git.
85
862. Make sure that testsuites.xml refers to the testsuite.xml file in
87   the 'testsuite' package.
88
893. (Optional) Checkout the DocBook testdocs module from the Subversion
90   repository of the DocBook SourceForge project, e.g., into
91   '../testdocs':
92
93      cd ..
94      svn co \
95         https://docbook.svn.sourceforge.net/svnroot/docbook/trunk/testdocs \
96         testdocs
97
98   In the 'testdocs' directory, run 'make-testsuite.pl' from this
99   module to create a usable testsuite.xml file, e.g.:
100
101      cd testdocs
102      perl ../testing/make-testsuite.pl \
103         --stylesheet \
104         http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl \
105         . > testsuite.xml
106
107   Make sure that testsuites.xml in this module refers to the
108   testsuite.xml in the 'testdocs' directory.
109
110   DocBook testing is described further in the 'DocBook testdocs'
111   section below (and at http://xmlroff.org/wiki/DocBookTestdocs).
112
1134. Run configure to generate the Makefile:
114
115      ./configure
116
117   The parameters for controlling the test are set as configure
118   options.  Use './configure --help' to see the available options.
119
120   Processing instructions in the test results document may override
121   the default values of some paramters, but setting parameters as
122   configure options overrides both.
123
124   See below for configuring to use an alternative XSL processor.
125
126   (If starting from a Subversion checkout, run './autogen.sh'.)
127
1287. (Optional, Apache-only) Copy 'testing.conf' to your Apache2 conf.d
129   directory, e.g., '/etc/apache2/conf.d' (or make a symbolic link).
130   Modify the directory name in 'testing.conf' to match where you
131   installed this package.  Restart Apache.
132
133   If you needed to modify 'testing.conf' and are going to repeatedly
134   run 'configure', modify 'testing.conf.in' instead so you won't have
135   to keep redoing the changes.
136
1378. (Optional, non-Apache) Install update-results.pl in the cgi-bin of
138   your web server.
139
1409. (Optional) Make sure that your web server can open an 'index.html'
141   file in this directory and that the paths in update-results.pl are
142   correct for your setup.
143
144   Note that you may need to change the permissions on the current
145   directory and its descendant files and directories so both you and
146   the webserver UID (e.g., 'wwwrun' or 'www-data' for Apache2,
147   depending on your configuration) can create and modify files.
148
149   The simplistic solution (if you have the 'acl' option set for the
150   current file system in '/etc/fstab') is:
151
152      setfacl -m u:www-data:rwx .
153
154
1554. Running the tests
156====================
157
158All at once
159-----------
160
1611. Run make:
162
163      make -k
164
165Individual steps
166----------------
167
1681. Run dotests.pl to run the tests:
169
170      perl dotests.pl .
171
1722. Compare results to reference versions and generate PNG versions of
173   files:
174
175      perl png+ref2stereo.pl .
176
1773. Generate an XML summary of the reslts:
178
179      perl testsuccess.pl . > testsuccess.xml
180
1814. Generate HTML reports of the tests and their results:
182
183      make index.html
184
185   To make a 'static' report without the forms for updating results,
186   use the '--disable-form' option when running configure.
187
188
1895. Working with the results
190===========================
191
1921. Open index.html in your web browser:
193
194      http://127.0.0.1/path/to/testing/index.html
195
196   or:
197
198      file:///path/to/testing/index.html
199
200   or start the threaded standalone web server:
201
202      perl threaded.pl
203
204   or start the standalone web server:
205
206      perl testing-server.pl
207
208   and open the page it suggests, e.g.:
209
210      http://localhost:8080/index.html
211
2122. For any test, you can click on the "Results" link to see individual
213   test results.
214
2153. If you did not create 'static' reports and you have
216   update-results.pl installed correctly, you can update the test
217   results using the form in the individual test result page.
218
219   At present, the test result page is updated to reflect your changes
220   only when using 'threaded.pl'.  Otherwise, the page is updated only
221   once you run 'testsuccess.xsl' again.
222
223
2246. Bundling the test results
225============================
226
2271. Run the 'dist-results' target:
228
229      make -k dist-results
230
231   This regenerates the HTML output with 'static' reports and bundles
232   all the reports and associated output and image files into a
233   gzipped tar archive.
234
235   The reports, when unbundled, can be viewed but not modified.
236
237   The individual reports contain links to their input XML and XSLT
238   files, and relative links will only work when the reports and the
239   testsuites used when running the tests are installed in the same
240   locations relative to each other as they were when the tests were
241   run and the reports were generated.
242
243
2447. When the test suite changes
245==============================
246
2471. Re-run test2sh.xsl to update the script that runs the tests:
248
249      xsltproc --novalid test2sh.xsl test2sh.xsl
250
2512. Create a new, temporary test results XML file:
252
253      xsltproc --novalid testsuites2testresults.xsl testsuites.xml > \
254         tmp.xml
255
2563. Merge the generated <testresult> elements for the new tests into
257   the existing testresults.xml file.
258
259   'testresults.xml' is the default name.  If you specified a
260   different filename when you ran 'configure', modify that file.
261
2624. Run the tests, which will now include the new tests.
263
264
2658. Setting up a web server for updating results
266===============================================
267
268There are currently three ways to run a web server so you can update
269the test results using the form in the individual HTML reports:
270
271 - threaded.pl
272
273 - testing-server.pl
274
275 - Apache
276
277threaded.pl
278-----------
279
280Based on a 'HTTP::Daemon::Threaded' example, this supports updating
281individual results' HTML.
282
283testing-server.pl
284-----------------
285
286Based on 'HTTP::Daemon', this supports updating the main test results
287XML file from individual reports but does not regenerate the
288individual report's HTML at this time.
289
290Apache and update-results.pl
291----------------------------
292
293Allowing the update-results.pl CGI script to modify files is probably
294a security no-no, so it's probably best to use this setup on a machine
295that isn't accessible to the wider Internet.
296
297Suggestions on how to improve the setup are welcome, but the best way
298that has been found so far is:
299
3001. Copy 'testing.conf' to '/etc/apache2/conf.d' (or make a symbolic
301   link to the file).
302
3032. Adjust the paths in the 'testing.conf' copy as necessary to
304   match your setup.
305
306   The '--with-project-name' and '--with-basename' values are used in
307   'testing.conf'.
308
3093. Restart apache, e.g.:
310
311      sudo /etc/init.d/apache2 restart
312
3134. Make the group id sticky (i.e., 'chmod g+s ...') for the current
314   directory and all the generated directories.
315
316   Alternatively, a simplistic solution if you have the 'acl' option
317   set for the current file system in '/etc/fstab' is:
318
319      setfacl -m u:www-data:rwx .
320
321
322A previous method that would require rolling back changes in
323testsuccess.xsl and update-results.pl is:
324
3251. Create a new group, e.g. 'testing'.
326
3272. Make the user id that runs the web server (e.g., 'apache') a member
328   of the group.
329
3303. Make any users who will be running the scripts and stylesheets also
331   members of the group.
332
3334. Change the group id of the generated test result files and report
334   files to the new group.
335
3365. Change the mode of the generated test result files and report files
337   to '664'.
338
3396. Change the group id of the 'testing' directory to the new group.
340
3417. Make the group id sticky (i.e., 'chmod g+s ...') for the current
342   directory and all the generated directories.
343
344It is probably simplest to create the group and just set the sticky
345group id of the 'testing' directory *before* running any of the
346stylesheets or scripts.
347
348
3499. Testing an Alternative XSL Processor
350=======================================
351
352You can test XSL processors other than xmlroff by specifying the
353--with-command-patterns parameter to 'configure'.
354
355The value of --with-command-patterns is a list of one or more command
356patterns, separated by semicolons.
357
358A command pattern is the format of the command to run the XSL
359processor, but with format strings, e.g., '%p', at the points in the
360command where the testing system substitutes values.
361
362The format strings are:
363
364   %p   XSL processor
365
366        Specified by --with-xsl-processor.
367
368   %c   XSL processor flags
369
370        Specified by --with-xsl-processor-flags.
371
372        When --with-xsl-processor-flags is not specified, this format
373        string is not substituted.
374
375   %i   Input XML file
376
377        Taken from the test definition, and potentially different for
378        every test.
379
380   %s   Stylesheet file
381
382        Either taken from the test definition or, when not specified
383        in the test definition and --with-default-stylesheet is
384        specified, the default stylesheet.
385
386        When neither a per-test stylesheet nor a default stylesheet is
387        specified, this format string is not substituted.
388
389   %o   Output file
390
391        The filename is determined by the testing module and is (or
392        should be) different for each test.
393
394   %%   Literal '%'
395
396If a command pattern contains unsubstituted format strings, e.g., if
397the pattern contains '%c' but --with-xsl-processor-flags is
398unspecified, then the command pattern is disregarded and the next
399pattern is evaluated.
400
401If none of the command patterns are completely substituted, then
402things will probably not work.
403
404For example, the default command patterns value is:
405
406   %p -o %o %c %i %s;%p -o %o %c %i;%p -o %o %i %s;%p -o %o %i
407
408The first pattern is disregarded when either %c or %s is unevaluated;
409the second, when %c is unevaluated; the third, when %s is unevaluated;
410and the fourth will always be evaluated since it contains no optional
411format strings.
412
413This example shows how to configure to test using the Antenna House
414Formatter on Linux:
415
416   ./configure --with-xsl-processor=/usr/AHFormatterV6_64/run.sh \
417      --with-command-patterns="%p -o %o -d %i"
418
419This example shows how to configure to test using FOP on Linux:
420
421   ./configure --with-xsl-processor=fop \
422      --with-command-patterns="%p -r -xml %i -xsl %s -pdf %o;%p -r -fo %i -pdf %o"
423
424
42510. DocBook testdocs
426===================
427
428The DocBook SourceForge project maintains a set of test documents.
429
430At the time of this writing, you have to check them out from the
431DocBook Subversion repository if you want to use them:
432
433   svn co \
434      https://docbook.svn.sourceforge.net/svnroot/docbook/trunk/testdocs \
435      testdocs
436
437This checkout doesn't get you any 'callout' symbols that are usable
438by the test documents.  The DocBook testdocs fit in with the rest of
439the SourceForge DocBook project's setup, so you need to fake some of
440the DocBook setup for the callout graphics to work:
441
442   cd testdocs/tests
443   svn co \
444      https://docbook.svn.sourceforge.net/svnroot/docbook/trunk/xsl/images \
445      images
446
447The testdocs checkout also does not include a test definitions file
448(i.e., a 'testsuite.xml' file) that is needed by this module, so you
449need to make your own.
450
451'make-testsuite.pl' in this module generates a usable 'testsuites.xml'
452that includes a '<testcase>' element for each XML file in
453subdirectories of the specified directory.  Since testdocs currently
454includes some XML files that aren't DocBook files, some of the
455generated test cases will always fail; you can edit those out of the
456generated 'testsuite.xml', but they will be regenerated if you ever
457regenerate the 'testsuite.xml' after updating your testdocs checkout.
458
459The DocBook testdocs need a stylesheet if they are to be formatted
460(which, in a nutshell, is the whole point of DocBook and the DocBook
461SourceForge project).  There are two alternatives for specifying the
462stylesheet:
463
464 - If you are also testing FO documents in the same run, e.g., also
465   testing the xmlroff testsuite, then you need to specify the
466   stylesheet for each testcase by specifying it when running
467   'make-testsuite.pl':
468
469      perl ../testing/make-testsuite.pl \
470         --stylesheet \
471         http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl \
472         . > testsuite.xml
473
474 - Alternatively, if you are testing only DocBook documents, you can
475   specify the DocBook stylesheet as the default stylesheet when
476   congiguring testing:
477
478      perl ../testing/make-testsuite.pl . > testsuite.xml
479      cd ../testing
480      ./configure \
481         --with-default-stylesheet=http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl
482
483   This could be useful if you want to test different versions of the
484   DocBook stylesheets.
485
486
48711. FOP "layoutengine" Tests
488============================
489
490make-fop-testsuite.pl creates a W3C-format testsuite file from FOP
491"layoutengine" tests.
492
493Usage:
494
495   make-fop-testsuite.pl [--verbose] [--stylesheet Stylesheet] \
496      [--title Title] TestsDir
497
498where:
499
500  Title         = Profile name in the generated testsuite
501  Stylesheet    = Filename or URL of stylesheet for all tests
502  TestsDir      = Directory containing the tests directories
503
504
50512. Setting Defaults in the Test Results File
506=============================================
507
508Configuring a test run using many non-standard parameters -- e.g. when
509testing an alternative XSL processor or testing a specific xmlroff
510backend and output format -- can make a long 'configure' command line
511that is not so easy to reconstruct.
512
513Also, when you redo a test run with the same parameters, you typically
514want to update the test results from the last run to reflect any
515changes in the test output.
516
517Since the test results are so closely related to the test parameters
518used for the test run, this module supports storing some parameters as
519processing instructions in the test results file and using those
520parameters when setting up to re-run the tests.
521
522The 'configure' options and their corresponding PIs (with "xt-" prefix
523meaning "xmlroff testing") are:
524
525 --with-basename              xt-basename
526 --with-color                 xt-color
527 --with-command-patterns      xt-command-patterns
528 --with-default-stylesheet    xt-default-stylesheet
529 --with-project-name          xt-project-name
530 --with-server-port	      xt-server-port
531 --with-test-subset           xt-test-subset
532 --with-testsuites            xt-testsuites
533 --with-title 		      xt-title
534 --with-trac                  xt-trac
535 --with-xsl-processor         xt-xsl-processor
536 --with-xsl-processor-flags   xt-xsl-processor-flags
537
538The options without a PI are:
539
540 --with-changelog-oldest
541 --with-convert
542 --with-compare
543 --with-composite
544 --with-debug
545 --with-identify
546 --with-test-results
547 --with-xsltproc
548
549The priority for setting a parameter, from lowest to highest, is:
550
551 - Default hardwired into 'configure'
552 - PI in test results XML
553 - 'configure' command-line options
554
555When you run 'configure', the 'configure' script outputs a summary of
556the settable parameters and where the parameter was set ('default',
557'results', or 'option').
558
559
56013. Gory Details
561================
562
563Test Cases
564----------
565
566The XSL Working Group (WG) had to demonstrate that every feature of
567XSL had been implemented before XSL 1.0 advanced from Candidate
568Recommendation (CR) to Proposed Recommendation (PR).
569
570In 2001, the WG and NIST (National Institute of Science and Technology
571in the U.S.) developed a DTD for both test suite descriptions and test
572suite results, and NIST and the XSL formatter implementors contributed
573both test suites and their descriptions.  The DTD was augmented with
574more attribute valuess for new formatting objects for the XSL 1.1 CR. See
575http://www.w3.org/Style/XSL/TestSuite/.
576
577When working on the XSL 1.0 CR test suite results with Max Froumentin
578of the W3C, we developed a simple, well-formed document type for
579referring to multiple test suite descriptions.
580
581The XSL 1.0 CR test suite was put on the web.  NIST continued to
582develop tests and later produced an expanded set of test cases.  See
583http://xw2k.sdct.itl.nist.gov/brady/xml/generate.asp?tech=../../carmelo/XSL.
584
585The test cases currently available for testing xmlroff are the XSL 1.0
586CR test cases, the NIST test cases, and some test cases developed
587specifically for xmlroff.
588
589make-fop-testsuite.pl creates a W3C-format testsuite file from FOP
590"layoutengine" tests.
591
592
593config.h, config.pl, config.xsl
594-------------------------------
595
596These specify parameters used by the XSLT stylesheets and Perl
597programs that actually do the work.
598
599The other XSLT stylesheets import config.xsl.
600
601You can still override any of these parameters by specifying the
602parameter on the xsltproc command line.
603
604Some of the files that you specify in these parameters won't
605necessarily exist the first time that you run the stylesheets.
606
607
608test2sh.xsl
609-----------
610
611This should be run manually whenever the test cases are modified.
612
613Usage:
614
615   xsltproc --novalid test2sh.xsl test2sh.xsl
616
617Applicable 'configure' parameters are:
618
619 - '--with-testsuites' sets the filename of the XML document referring
620   to multiple test suite descriptions.
621
622 - '--with-test-subset' restricts tests to those testcases with a
623   matching @profile value.
624
625The stylesheet expects that the current directory will have a
626subdirectory with the same name as the subdirectory of each of the
627test suite description files referred to by the file referred to by
628the 'testsuites' parameter.  I.e., if 'testsuites.xml' refers to
629'../NIST/testsuite.xml', then test2sh.xsl expects to be able to write
630to a 'NIST' subdirectory of the current directory.
631
632In each subdirectory corresponding to the subdirectories of the
633referred-to test suite descriptions, test2sh.xsl writes a 'test.sh'
634file containing the shell commands to run xmlroff on each test case
635described in the test suite description.
636
637For each test case, test2sh.xsl writes shell commands to:
638
639 - Run xmlroff on the test case input file or files, with output
640   written to a PDF file named after the input file and error and log
641   output written to a .log file also named after the input file.
642
643The 'test.sh' file also runs a simple command-line Perl script on the
644log files to remove process IDs from the messages in the .log files so
645the files can be meaningfully diffed.
646
647
648test2makefile.xsl
649-----------------
650
651This is a work in progress for letting Make work out when a test needs
652to be redone.
653
654Also used for copying testsuite samples to reference directory, and
655vice-versa.
656
657
658dotests.pl
659----------
660
661This Perl script executes the shell scripts created by test2sh.xsl.
662
663It could be run nightly as part of a cron job.
664
665Usage:
666
667   perl dotests.pl .
668
669This script is run from the directory containing the subdirectories
670with the test.sh shell scripts.
671
672The Perl script scans the subdirectories of the current directory for
673test.sh files.
674
675In each subdirectory containing a test.sh file, the Perl script:
676
677 - Runs test.sh, with output written to 'test.out' in the current
678   subdirectory.
679
680
681png+ref2stereo.pl
682-----------------
683
684Diff the generated PDF against the corresponding reference PDF in the
685'ref' directory, writing the diff output to the 'diff' directory.
686
687If a PDF file has changed, run ImageMagick's 'convert' program to make
688a PNG file of each page of the PDF and then diff the new PNG with the
689corresponding reference PNG in the 'ref' directory.
690
691Potentially runs ImageMagick's 'composite' program with the 'stereo'
692argument on each generated PNG file for which there is a corresponding
693PNG file in the 'ref' subdirectory.  The output, which is written to a
694like-named file in the 'stereo' subdirectory, shows the differences
695between the generated file and the reference version in the 'ref'
696subdirectory.
697
698The script only runs 'composite' if the 'diff' file size is non-zero
699or missing and the 'diff' file is newer than the PNG, etc.
700
701
702testsuccess.pl
703--------------
704
705This Perl script is run after dotests.pl.
706
707Usage:
708
709   perl testsuccess.pl . > testsuccess.xml
710
711It generates an XML file that lists file names and file sizes of test
712result files.  That XML file is used as input to the XSLT stylesheet
713that generates the HTML reports.  Using this script saves having to
714worry about trying to find and use XSLT processor-specific extensions
715for accessing file details.
716
717testsucess.pl scans the subdirectories containing the test results and
718outputs a well-formed XML document listing the file names and file
719sizes for all the files relating to each PDF file.
720
721
722testresults.xml
723---------------
724
725This is the record of the processor's results for each test.  It
726conforms to the DTD from the XSL WG.
727
728You can specify a different results file using the --with-test-results
729option of 'configure'.
730
731This file should have a new entry added to it for every new test case
732added to the test suite.
733
734
735testsuites2testresults.xsl
736--------------------------
737
738This generates a new testresults.xml file from a testsuites.xml file.
739
740The stylesheet doesn't preserve anything from an existing
741testresults.xml file, so it's best to write the output to a temporary
742file and then merge any new entries into an existing testresults.xml
743file.
744
745Usage:
746
747   xsltproc --novalid testsuites2testresults.xsl testsuites.xml > tmp.xml
748
749
750testsuccess.xsl
751---------------
752
753This is run after testsuccess.pl has generated the XML file listing
754the test result file names and file sizes.
755
756It generates HTML reports: one *large* report summarizing all the test
757cases and their results, plus an individual report for each test case.
758
759Usage:
760
761   xsltproc -o testsuccess.html --novalid \
762      --stringparam date "`date`" \
763      testsuccess.xsl testsuccess.xml
764
765The parameters controlling the transformation are set when you run
766'configure'.
767
768 - '--with-testsuites' sets the filename of the XML document referring
769   to multiple test suite descriptions.
770
771 - '--with-test-results' sets the filename of the XML document
772   recording the test results.
773
774 - '--disable-individual' disables generating an individual report for
775   each test result
776
777 - '--disable-form' disables generating a form in individual reports
778
779 - '--disable-reference' disables including the reference and stereo
780   images in individual reports
781
782 - '--with-trac' sets the base URL for linking from ticket references
783   (e.g., '#21') in test result descriptions to tickets in a Trac
784   (e.g., http://xmlroff.org/ticket/21).
785
786   '--without-trac' disables creating links for ticket references.
787
788 - '--with-color' sets the base colour for the reports.  The colour
789   and lighter shades of the colour are used for backgrounds in the
790   generated HTML.
791
792The summary report (and the individual reports) include information
793from both the test case description and the xmlroff test results.
794
795The test case description information is obtained by following file
796references in the file referred to by the '--with-testsuites' option
797to individual test suite description files.
798
799The xmlroff test results information is obtained from both
800testresults.xml and testsuccess.xml.
801
802The summary report is a large table with one row for each test case.
803Each row contains:
804
805 - The test case ID.
806
807 - An indication of the value of the test result attributes from
808   testresults.xml for the test.
809
810 - The test result's descriptive text from testresults.xml.
811
812 - A link to the PDF output, if any.
813
814 - A link to the report HTML for the individual test.
815
816 - An indication of the number of output pages and, when individual
817   reports are being produced, the types of the result files present.
818
819
820result-doc.xsl
821--------------
822
823Imported by testsuccess.xsl and used to generate individual report
824HTML for each test.
825
826The individual reports contain:
827
828 - The "path" to the test case
829
830 - The test case information:
831
832    - Test description
833
834    - Which FO is being tested, which could be 'multiple'
835
836    - Input XML file, which could be an FO file
837
838    - Input XSLT stylesheet, if any
839
840    - Sample result file, if any provided by test case author
841
842 - The test result information:
843
844    - Whether or not the test result agrees with the test case
845      description and/or sample results
846
847    - Whether or not the XSL formatter will in the future support the
848      FOs and properties used in the test
849
850    - Whether or not any differences between the test result and the
851      test case description and/or sample results indicates a problem
852      with interpreting the XSL 1.0 Recommendation
853
854    - Whether or not any differences between the test result and the
855      test case description and/or sample results indicates a problem
856      with the test.
857
858    - Any further textual description
859
860   The test result information is usually presented as an HTML form so
861   the results can be updated from the individual report.  Use the
862   --disable-form option of 'configure' to generate reports with
863   static tables instead of forms.
864
865 - For each page in the test result PDF:
866
867    - The PNG for the page
868
869   and, unless --disable-reference was specified when running
870   'configure':
871
872    - If there are differences between the current PNG and the
873      corresponding 'ref' PNG:
874
875       - The PNG for the page from the 'ref' subdirectory
876
877       - The PNG for the 'stereo' composite showing the differences
878         between the two PNGs
879
880    - If, instead, there are no differences between the current PNG
881      and the corresponding 'ref' PNG:
882
883       - text stating 'Reference is identical to current.'
884
885Selecting the 'Update' button in the 'Result' form both updates the
886test result information in testresults.xml and copies the current PNG
887files to the 'ref' subdirectory.  Unfortunately, it does not update
888the form because the current XSLT stylesheet generates both the
889summary report and all the individual reports, all of which takes a
890*long* time.  Ideally the summary report and the individual reports
891should be XHTML that can be simply modified, not regenerated, whenever
892a test's results are updated.
893
894The summary report should also be broken into multiple HTML files, one
895or more for each test suite, but that also hasn't been done yet.
896
897
898update-results.pl and update-result.xsl
899---------------------------------------
900
901update-results.pl is the CGI script called when the 'Update' button in
902an individual report is selected.  It modifies testresults.xml using
903the update-result.xsl stylesheet, copies the current test result's PNG
904files to its 'ref' subdirectory, zeroes the corresponding files in the
905'diff' subdirectory, and removes the corresponding files in the
906'stereo' subdirectory.
907
908
90914. License
910===========
911
912The stylesheets and other content are licensed under a BSD license.
913See the file COPYING for details.
914
915
916Tony Graham
9171 October 2011
918