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

..03-May-2022-

contents/H03-May-2022-11,6619,542

formatting/H03-May-2022-3,3513,044

indices/H03-May-2022-31,66524,472

layout/H03-May-2022-116,83170,883

many_input_files/H03-May-2022-6,1735,327

nested_formats/H03-May-2022-87,49065,265

sectioning/H03-May-2022-9,3038,638

test_scripts/H03-Jul-2021-2,2221,234

tex_html/H03-May-2022-22,02311,154

Makefile.amH A D22-Nov-20201.9 KiB5428

Makefile.inH A D03-May-2022120.7 KiB2,9052,751

Makefile.in.bakH A D03-Jul-2021120.7 KiB2,9052,830

Makefile.onetstH A D30-Jun-20216.5 KiB125108

READMEH A D18-Feb-20217.8 KiB217158

coverage_macro.texiH A D11-Mar-202119.7 KiB776637

parser_tests.shH A D11-Oct-2020765 4328

run_parser_all.shH A D16-Feb-202111.8 KiB387298

README

1$Id$
2texinfo/tp/tests/README
3
4  Copyright 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
5  Free Software Foundation, Inc.
6
7  Copying and distribution of this README file, with or without
8  modification, are permitted in any medium without royalty provided the
9  copyright notice and this notice are preserved.
10
11Files anywhere within the texinfo/tp/tests/ subdirectory which have no
12other copyright notice are hereby placed in the public domain.
13
14This directory contains tests of the texi2any program.
15
16Prerequisites
17=============
18To run this testsuite, sed, awk, diff (with -u) are used.
19For LaTeX2HTML tests (not run by default), mktemp
20understanding the -d option is also required.
21
22Some tests may also require a case insensitive filesystem.
23
24
25Running the testsuite
26=====================
27This testsuite can be run one of the following ways:
28
29* Using the makefile rules: "make check" (in this directory)
30These tests use the scripts under the test_scripts directory.
31
32* Using ./run_parser_all.sh with the directories one want to run the
33tests in given as arguments, for example "./run_parser_all.sh -dir formatting".
34To run just one test, give the test name, e.g.
35"./run_parser_all.sh -dir formatting cond".
36
37Checking test results
38---------------------
39The test results are in the out_parser directories; the reference
40results are in res_parser directories.  There can be these pairs.
41- out_parser/ and res_parser/ for html output in texi2html style;
42- out_parser_html/ and res_parser_html/ for html output in texi2any style;
43- out_parser_info/ and res_parser_info/ for info results;
44and diffs are put in the diffs/ subdir.
45
46For example, to investigate a failure in the
47test_scripts/layout_formatting_docbook.sh test, compare the contents of the
48files in the layout_res_parser/formatting_docbook and
49layout_out_parser/formatting_docbook directories, e.g.
50
51diff {res,out}_parser/formatting_docbook/formatting.2
52
53Also look in the layout/diffs directory.
54
55If the test results are as expected, copy the output files onto the
56reference files.  Otherwise, if they need more investigation, see "Tests
57specification" below, to find out what input file, etc. was used for the
58test.  Sometimes you need to use "makeinfo -F" to force an output file
59to be created.
60
61When running tests via parser_tests.sh or run_parser_all.sh, then
62a test failure causes
63 F: a_test_directory
64to be printed.  If there is a diff with the references, then
65 D: a_test_directory
66is printed. If there are no reference to compare with, then
67 no res: a_test_directory
68is printed.
69
70If a whole directory check run using './parser_tests.sh' had no failure,
71the directory name is printed followed by a ok; it is followed
72by a fail if there was a failure.
73
74The test results are in a directory below the out directories. This
75directory name can be considered as the test name. Let's call it a_test
76for the remainder of the explanation. The stderr output is in
77out_parser/a_test/a_test.2, stdout output is in
78out_parser/a_test/a_test.1.  All the commands called are output in
79tests.log.
80
81Regenerating test results
82=========================
83
84To update the test results, first the tests must be run as above.
85
86Giving -copy as the first argument to ../run_parser_all.sh or
87parser_tests.sh will cause the reference results to be copied
88from the results the last time the tests were run.  For example,
89to update the reference results for one particular test:
90
91$ ./parser_tests.sh -copy formatting
92The copy-* make targets update all the references for various large sets
93of tests via this method.
94
95Exception: in the many_input_files subdirectory, the *parser*.sh scripts
96can't be used for updating.  Instead, the Makefile's copy-tests and
97copy-tex-html targets do it directly.
98
99
100Testsuite and document strings translations
101===========================================
102
103At least one test, layout/formatting_fr_icons, depends heavily on
104the translation of strings that can be translated and incorporated in
105output documents.  The translations are in the po_document directory.
106These translations are managed by the translation project and only
107updated for the release.  They may lag behind the changes in code,
108which may be problematic for test results.  The translations in
109po_document should never be changed, as they will be overwritten by
110the translation project.  If the translations need to be modified
111for the test results, a filter script should be used instead.  An
112example of such a script can be seen in po_document/fix-translations.sh.
113
114
115TeX4ht and LaTeX2HTML tests
116===========================
117The tex4ht and latex2HTML related tests are not run automatically, as
118some test results involving latex2HTML or tex4ht depend on the setup and
119version of these tools.
120
121These tests may be run by
122  make tex-html-checks
123
124For the tests that use latex2html, to avoid the test failing if there is
125a dot in the cwd, mktemp is used to create a temporary directory, and
126the directory is passed through on the command line.
127
128
129Tests specification
130===================
131Test runs are driven by the contents of the list-of-tests file in
132each subdirectory. This is a line-oriented file. A # starts a
133comment, except that the very first line of the file can be, e.g.,
134# formats :html
135which says which formats to generate.  If no format is specified
136on the first line, -c TEXI2HTML is passed, which sets html
137to be output and some formatting options.
138
139Otherwise, each non-empty non-comment line describes a test.  The first
140word on the line is the test name which corresponds also with the
141resulting directory (what we called a_test above).  It is followed by
142the source manual name. The source manual name has to have the .texi
143extension.  Optionally, additional arguments can be given on the rest of
144the line.
145
146So, for example, the line
147
148a_test manual.texi
149
150specifies that for the test a_test, the file manual.texi is processed
151and results are put are put in the a_test directory.  The line:
152
153a_test_split_chapter manual.texi --split chapter
154
155specifies that the results of the processing of manual.texi with additional
156command line arguments --split chapter will be in the a_test_split_chapter
157directory.
158
159Common .texi
160------------
161A common .texi file should be in the top-level directory (there is such an
162example with coverage_macro.texi).
163
164
165Init files
166----------
167Init files are searched for in ../t/init/.
168
169
170Creating a new test
171===================
172- choose the subdir here for the new test.  Each subdir only generates
173output in one or two formats (according to the `formats' line in
174its list-of-tests), so if you want to test a particular output
175format, use the right place.
176
177- add the line to subdir/list-of-tests as described above.
178- most probably, create the needed subdir/*.texi file
179- ./run_parser_all.sh -dir subdir newtest
180
181This will create subdir/out_parser*/newtest/ with the test results
182(as explained above), as well as stdout in newtest.1 and stderr in newtest.2.
183Look carefully to be sure they are as they should be.
184
185For XML output, perhaps check validity using the commands in tp/TODO.
186
187When things look good, use the -copy option to create the
188subdir/res_parser*/newtest/ subdirs and copy the output files there.
189
190The test run will be logged in subdir/test_log/newtest.log,
191including the exact invocation of texi2any, which can alter anything.
192For even more, use sh -vx to show exactly what run_parser_all is doing.
193
194When satisfied, add the .texi in subdir/Makefile.am.
195
196Of course commit all the files and try a make check afterward to verify
197it gets run, and passes.
198
199See tp/t/README for info about those tests.
200
201Deleting a test
202===============
203
204Run "make" to recreate the test scripts (which runs
205../maintain/regenerate_cmd_tests.sh).
206
207git status test_scripts/
208
209Then "git rm" the missing files.
210
211Delete directories containing reference test results, e.g.
212
213ls -d formatting/*/unknown_nodes_renamed
214rm -r formatting/out_parser/unknown_nodes_renamed
215git rm formatting/res_parser/unknown_nodes_renamed
216
217