]>
diplodocus.org Git - nmh/blob - test/tests/manpages/test-manpages
2 ######################################################
4 # Test that the manpages don't have any syntax errors
5 # as detected by groff.
7 ######################################################
9 # First find out whether we have a groff on the path:
11 # portable implementation of 'which' utility
22 if [ -f "$D/$PROG" ] && [ -x "$D/$PROG" ]; then
23 printf '%s\n' "$D/$PROG"
30 if [ -z "$(findprog groff)" ]; then
31 echo "Test $0 SKIP (missing groff)"
35 cd $MH_TEST_DIR/share
/man
37 # groff will still exit with status zero even if warnings
38 # were emitted, so we have to jump through hoops to
39 # find out if any were emitted.
41 expected
=$MH_TEST_DIR/$$.expected
42 actual
=$MH_TEST_DIR/$$.actual
44 # There aren't any expected warnings at the moment but
45 # this mechanism does let us add them if necessary later.
46 rm -f "$expected" "$actual"
47 touch "$expected" "$actual"
49 for manpage
in man?
/*.?
; do
50 groff -Tutf8 -mandoc -wmac "$manpage" > /dev
/null
2>>"$actual"
53 diff -u "$expected" "$actual"