doctest 839 B

123456789101112131415161718192021222324252627282930
  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/mc.1.in || { echo "ERROR: cannot read doc/mc.1.in" 2>&1; exit 1; }
  17. # Test the documentation for possible errors.
  18. one_test find doc -name '*.[1-9].in' -exec groff -wall -mandoc -Tps {} \;
  19. one_test find doc -name '*.[1-9].in' -exec nroff -mandoc -Tlatin1 {} \;
  20. # Check the English manuals to be in ASCII.
  21. one_test find doc -maxdepth 1 -name '*.[1-9].in' -exec groff -wall -Tascii {} \;
  22. rm -rf doctest.err
  23. exit 0