README 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. $Id$
  2. texinfo/texi2html/tests/README
  3. Copyright (C) 2010 Free Software Foundation, Inc.
  4. Copying and distribution of this README file, with or without
  5. modification, are permitted in any medium without royalty provided the
  6. copyright notice and this notice are preserved.
  7. Files anywhere within the test/ subdirectory which have no other
  8. copyright notice are hereby placed in the public domain.
  9. Test results are not in CVS. To download them, you need wget. To get the
  10. archives, and then unpack them, run
  11. ./manage_test_archives.sh get
  12. ./manage_test_archives.sh unpack
  13. To clean up archives and download directory, run
  14. ./manage_test_archives.sh clean
  15. To run the tests, it should be necessary to configure and build texi2html.
  16. To do that, in the texi2html directory, run
  17. autoreconf && ./configure && make
  18. Prerequisites
  19. =============
  20. To run this testsuite, sed (with -i), awk, diff, mktemp are used. To
  21. find the same results, tex4ht, latex2HTML, html2wiki, perl with unicode
  22. support and the Text::Unidecode perl module have to be installed (with their
  23. dependencies). It is possible that some test results involving latex2HTML,
  24. tex4ht or html2wiki depend on the setup and version of these tools, so you may
  25. get false negative. If tex4ht, latex2HTML or html2wiki are not found, the
  26. corresponding tests are skipped.
  27. Some tests also require a case insensitive filesystem (especially in
  28. encodings/).
  29. Running the testsuite
  30. =====================
  31. This testsuite can be run
  32. * using the makefile rules: check for the base tests, long-check for
  33. the long tests, or all-checks for both.
  34. * using ./tests.sh with the list of directories in argument one want to
  35. run the tests in. In general you should give all as first tests.sh
  36. argument, like
  37. ./tests.sh all <directories...>
  38. * by going in one directory and running ../run_test_all.sh, like
  39. $ cd formatting
  40. $ ../run_test_all.sh
  41. * by going in one directory and running one specific test, like
  42. $ cd formatting
  43. $ ../run_test_all.sh quotes
  44. (see below for info on how test names are specified).
  45. The test results are in the out directories; the reference results are
  46. in res directories; there are 3 out and res directories, out/ and res/
  47. for the html results in the texi2html style, out_info and res_info
  48. for the info output a la makeinfo and out_all and res_all
  49. for the texi2any output. diffs are put in diffs.
  50. If a test failed,
  51. F: a_test_directory
  52. is printed, if there is a diff with the references, a
  53. D: a_test_directory
  54. is printed. If there are no reference to compare with,
  55. no res: a_test_directory
  56. is printed.
  57. If a whole directory check run using './tests.sh all' had no failure,
  58. the directory name is printed followed by a 0; it is followed
  59. by a 1 if there was a failure.
  60. The test results are in a directory below the out directories. This
  61. directory name can be considered as the test name. Let's call it a_test
  62. for the remaining of the explanation. The stderr output is in
  63. out/a_test/a_test.2, stdout output is in out/a_test/a_test.1. All
  64. the commands called are output in tests.log.
  65. giving -copy in argument to tests.sh all or ../run_test_all.sh will
  66. cause the references to be regenerated. This can also be achieved with
  67. the copy-tests make target.
  68. Tests specification
  69. ===================
  70. Test runs are driven by the content of the tests.txt file. It is a line
  71. oriented file. A # starts a comment. Each line describes a test. The
  72. first word on the line is the test name which corresponds also with the
  73. resulting directory (what we called a_test above). It is followed by
  74. the source manual name. The source manual name has to have the .texi
  75. extension. Optionnally additional arguments can be given on the
  76. remaining of the line.
  77. So, for example, the line
  78. a_test manual.texi
  79. specifies that for the a_test test, the file manual.texi is processed and
  80. results are put are put in the a_test directory. The line:
  81. a_test_split_chapter manual.texi --split chapter
  82. specifies that the results of the processing of manual.texi with additional
  83. command line arguments --split chapter will be in the a_test_split_chapter
  84. directory.
  85. Using "texi" as the test name is special. In that case the directory name
  86. is constructed by appending _ followed by the manual name without the .texi
  87. extension to "texi". And the result is not processed normally, but instead
  88. macros are expanded and regions that are not processed removed and the
  89. result is put in a file with the same name than the manual. Similar result
  90. files but with include file, macro and line number informations are put in
  91. files with the .texi extension replaced by .passtexi and .passfirst. More
  92. precisely, the .passtexi file corresponds with the texi after the first
  93. pass and the .passfirst file corresponds with the result after the second
  94. pass.
  95. So, for example, the tests.txt line
  96. texi manual.texi
  97. results in the following: in the directory out/texi_manual the file
  98. manual.texi will have macros expanded and ignored regions removed, and
  99. the files manual.passtexi and manual.passfirst will contain the
  100. additional include file and line number informations corresponding with
  101. the texinfo at the end of the first and second pass.
  102. LaTeX2html
  103. ==========
  104. For the tests that use latex2html, to avoid the test failing if there is
  105. a dot in the cwd, mktemp is used to create a temporary directory, hopefully
  106. in /tmp, and the directory is passed through on the command line.
  107. Common .texi
  108. ============
  109. A common .texi file should be in the top-level directory (there is such an
  110. example with coverage_macro.texi). Currently there is no support for common
  111. init file, but it could be added easily.