Actually report errors. Don't leave empty files.

This commit is contained in:
Pavel Roskin 2002-11-05 18:01:58 +00:00
parent f203f0208e
commit da95c74579
1 changed files with 23 additions and 4 deletions

View File

@ -1,9 +1,28 @@
#!/bin/sh
set -e
function one_test () {
"$@" >/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
}
test -r doc/mc.1.in || { echo "ERROR: cannot read doc/mc.1.in" 2>&1; exit 1; }
# Test the documentation for possible errors.
find doc -name '*.[1-9].in' -exec groff -wall -mandoc -Tps {} \; >/dev/null 2>doctest-ps.out
find doc -name '*.[1-9].in' -exec groff -wall -mandoc -Tdvi {} \; >/dev/null 2>doctest-dvi.out
find doc -name '*.[1-9].in' -exec nroff -mandoc -Tlatin1 {} \; >/dev/null 2>doctest-nroff.out
one_test find doc -name '*.[1-9].in' -exec groff -wall -mandoc -Tps {} \;
one_test find doc -name '*.[1-9].in' -exec groff -wall -mandoc -Tdvi {} \;
one_test find doc -name '*.[1-9].in' -exec nroff -mandoc -Tlatin1 {} \;
# Check English manuals to be in ASCII.
find doc -maxdepth 1 -name '*.[1-9].in' -exec groff -wall -Tascii {} \; >/dev/null 2>doctest-ascii.out
one_test find doc -maxdepth 1 -name '*.[1-9].in' -exec groff -wall -Tascii {} \;
rm -rf doctest.err
exit 0