2002-10-30 10:37:53 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2002-11-05 21:05:31 +03:00
|
|
|
# Run this script in the top-level source directory to check the
|
|
|
|
# documentation for compatibility with groff and nroff.
|
|
|
|
|
2002-11-05 21:01:58 +03:00
|
|
|
set -e
|
|
|
|
|
2003-11-21 01:07:06 +03:00
|
|
|
one_test() {
|
2002-11-05 21:01:58 +03:00
|
|
|
"$@" >/dev/null 2>doctest.err
|
|
|
|
if test -s doctest.err; then
|
|
|
|
echo "ERROR messages follow:" 2>&1
|
|
|
|
cat doctest.err 2>&1
|
|
|
|
echo "ERROR while running following command:" 2>&1
|
|
|
|
echo "$@" 2>&1
|
|
|
|
echo "ERROR messages are preserved in doctest.err"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2011-02-16 23:21:01 +03:00
|
|
|
test -r doc/man/mc.1.in || { echo "ERROR: cannot read doc/mc.1.in" 2>&1; exit 1; }
|
2002-11-05 21:01:58 +03:00
|
|
|
|
2002-10-30 10:37:53 +03:00
|
|
|
# Test the documentation for possible errors.
|
2011-02-16 23:21:01 +03:00
|
|
|
for i in `find doc -name '*.[1-9].in'`; do
|
|
|
|
echo "test $i"
|
|
|
|
cat $i |preconv -e UTF8| groff -wall -mandoc -Tutf8 | grep "warning:"
|
|
|
|
done
|
|
|
|
|
|
|
|
for i in `find doc -name '*.[1-9].in'`; do
|
|
|
|
echo "test $i"
|
|
|
|
cat $i |preconv -e UTF8| nroff -Tutf8 -mandoc | grep "warning:"
|
|
|
|
done
|
2002-10-30 10:37:53 +03:00
|
|
|
|
2002-11-05 21:05:31 +03:00
|
|
|
# Check the English manuals to be in ASCII.
|
2002-11-05 21:01:58 +03:00
|
|
|
one_test find doc -maxdepth 1 -name '*.[1-9].in' -exec groff -wall -Tascii {} \;
|
|
|
|
|
|
|
|
rm -rf doctest.err
|
|
|
|
exit 0
|