texi2dvi.test 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #! /bin/sh
  2. # Copyright (C) 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
  3. #
  4. # This file is part of GNU Texinfo.
  5. #
  6. # GNU Texinfo is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License,
  9. # or (at your option) any later version.
  10. #
  11. # GNU Texinfo is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. required='tex'
  19. . ./defs || exit 1
  20. set -e
  21. # one_run ARGS -- FILES
  22. # ---------------------
  23. # Run texi2dvi with ARGS, expect the FILES to be left. Remove them.
  24. one_run ()
  25. {
  26. # Testing the local build mode.
  27. # Use @foo to check that -t works properly.
  28. echo "@foo" | create_input_texi
  29. TEXI2DVI_pass $(optionset_get 1 "$@") \
  30. -t '@macro foo' \
  31. -t 'Foo' \
  32. -t '@end macro' \
  33. input.texi
  34. # There should only be the expected FILES and the input file.
  35. assert_and_remove_files $(optionset_get 2 "$@") input.texi
  36. }
  37. one_run --batch \
  38. -- \
  39. input.aux input.cp input.dvi input.fn input.ky input.log \
  40. input.pg input.tp input.vr
  41. one_run --batch -o output.dvi \
  42. -- \
  43. input.aux input.cp input.fn input.ky input.log \
  44. input.pg input.tp input.vr output.dvi
  45. # Testing the clean build mode.
  46. for mode in --clean --build=clean
  47. do
  48. # There should only be the DVI and the TEXI file.
  49. one_run $mode --batch -- input.dvi
  50. # There should only be the DVI and the TEXI file.
  51. one_run $mode --batch -o output.dvi -- output.dvi
  52. done
  53. # Testing the tidy build mode.
  54. one_run --build=tidy --batch -o output.dvi \
  55. -- \
  56. output.dvi output.t2d
  57. # mostly-clean should remove auxiliary files, but not the expected
  58. # output.
  59. touch output.dvi
  60. one_run --build=tidy --batch -o output.dvi --mostly-clean \
  61. -- \
  62. output.dvi
  63. # There should only be the DVI and the TEXI file.
  64. create_input_texi </dev/null
  65. cp input.texi input2.texi
  66. one_run --clean --batch input.texi input2.texi \
  67. -- \
  68. input2.dvi input2.texi input.dvi