README 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. $Id$
  2. texinfo/tp/t/README
  3. Copyright 2010, 2011, 2012, 2013, 2014, 2015, 2016
  4. Free Software Foundation, Inc.
  5. Copying and distribution of this README file, with or without
  6. modification, are permitted in any medium without royalty provided the
  7. copyright notice and this notice are preserved.
  8. Files anywhere within the tp/t subdirectory which have no
  9. other copyright notice are hereby placed in the public domain.
  10. See also the tests in the tp/tests directory.
  11. These tests are run by "make check" under tp/. (The test files are
  12. listed in tp/Makefile.tres, which is a generated file.) A single .t
  13. test file can be run on its own with
  14. perl -w t/03coverage_braces.t
  15. Another way, which works when doing an out-of-source build, is
  16. make check TESTS=t/03coverage_braces.t
  17. Most test files use a testing infrastructure from t/test_utils.pl.
  18. The run_all function from that file runs the tests that have been
  19. specified.
  20. In that case the reference output files for the test of a test category
  21. $test_category.t file are in t/results/$test_category/. For example, if
  22. after running "make check" test-suite.log contains a line like:
  23. FAIL: t/03coverage_braces.t 324 - test_image converted html
  24. you can see the difference between the expected and actual output with
  25. diff t/results/coverage_braces/test_image.pl{,.new}
  26. (Any number at the start of the name of the test, like "03" in this
  27. example, is removed.)
  28. To review all the differences for one of the *.t test files, you can do:
  29. for f in t/results/coverage_braces/*.pl; do echo --------; echo \
  30. Differences in $f; diff $f{,.new}; done | less
  31. The reference files are regenerated with the -g option given to the .t
  32. file, as in
  33. perl -w t/03coverage_braces.t -g
  34. To regenerate a specific test reference file, the test name should be
  35. given as an argument. For example, to just regenerate the reference
  36. files for the "test_image" test within t/03.coverage_braces.t, run
  37. perl -w t/03coverage_braces.t -g test_image
  38. Some tests under this directory use input files in the 'input_files'
  39. subdirectory. When adding a test that uses an input file, add its path
  40. to tp/Makefile.am.
  41. For some tests, as well as a .pl file as usual in results/*/, actual
  42. output files are generated. For those tests, there are directories with
  43. reference test results (with names prefixed with res_), and directories
  44. with the obtained results (with names prefixed with out_). For example,
  45. many of the tests whose results are in the 'results/indices' directory
  46. follow this format. (The same convention is used by the test suite in
  47. ../tests.)
  48. Tests can be managed using the script in ../maintain/all_tests.sh. For
  49. example, "./maintain/all_tests.sh generate" regenerates all of the
  50. reference test results (run from the upper-level directory), and
  51. "./maintain/all_tests.sh diff" makes a diff of all resulting files
  52. against references.
  53. From the top directory, you can also create texinfo files corresponding to
  54. tests by running something along the lines of:
  55. perl -w t/60macro.t -c
  56. to create a file for each of the tests in t/60macro.t, or for a specific
  57. test, here arg_body_expansion_order:
  58. perl -w t/60macro.t -c arg_body_expansion_order
  59. The output files will be created with -o, in t/output_files/$test_category/
  60. When adding Perl (sub)tests under t/, also run
  61. maintain/regenerate_file_lists.pl and/or maintain/prepare_perl_module_files.sh
  62. to regenerate MANIFEST and/or maintain/MANIFEST_generated_files, or a
  63. "plan" (aka results file) will be missing at distcheck.