A little fix...
[midnight-commander.git] / maint / doctest
bloba30a1e53af29bc8a08c1759758b23eabd5dbb56f
1 #!/bin/sh
3 # Run this script in the top-level source directory to check the
4 # documentation for compatibility with groff and nroff.
6 set -e
8 function one_test () {
9 "$@" >/dev/null 2>doctest.err
10 if test -s doctest.err; then
11 echo "ERROR messages follow:" 2>&1
12 cat doctest.err 2>&1
13 echo "ERROR while running following command:" 2>&1
14 echo "$@" 2>&1
15 echo "ERROR messages are preserved in doctest.err"
16 exit 1
20 test -r doc/mc.1.in || { echo "ERROR: cannot read doc/mc.1.in" 2>&1; exit 1; }
22 # Test the documentation for possible errors.
23 one_test find doc -name '*.[1-9].in' -exec groff -wall -mandoc -Tps {} \;
24 one_test find doc -name '*.[1-9].in' -exec groff -wall -mandoc -Tdvi {} \;
25 one_test find doc -name '*.[1-9].in' -exec nroff -mandoc -Tlatin1 {} \;
27 # Check the English manuals to be in ASCII.
28 one_test find doc -maxdepth 1 -name '*.[1-9].in' -exec groff -wall -Tascii {} \;
30 rm -rf doctest.err
31 exit 0