doctest 974 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. # Run this script in the top-level source directory to check the
  3. # documentation for compatibility with groff and nroff.
  4. set -e
  5. one_test() {
  6. "$@" >/dev/null 2>doctest.err
  7. if test -s doctest.err; then
  8. echo "ERROR messages follow:" 2>&1
  9. cat doctest.err 2>&1
  10. echo "ERROR while running following command:" 2>&1
  11. echo "$@" 2>&1
  12. echo "ERROR messages are preserved in doctest.err"
  13. exit 1
  14. fi
  15. }
  16. test -r doc/man/mc.1.in || { echo "ERROR: cannot read doc/mc.1.in" 2>&1; exit 1; }
  17. # Test the documentation for possible errors.
  18. for i in `find doc -name '*.[1-9].in'`; do
  19. echo "test $i"
  20. cat $i |preconv -e UTF8| groff -wall -mandoc -Tutf8 | grep "warning:"
  21. done
  22. for i in `find doc -name '*.[1-9].in'`; do
  23. echo "test $i"
  24. cat $i |preconv -e UTF8| nroff -Tutf8 -mandoc | grep "warning:"
  25. done
  26. # Check the English manuals to be in ASCII.
  27. one_test find doc -maxdepth 1 -name '*.[1-9].in' -exec groff -wall -Tascii {} \;
  28. rm -rf doctest.err
  29. exit 0