Re-work the test suite so it now works with Automake (via "make check").
[mmh] / test / manpages / test-manpages
1 #!/bin/sh
2 ######################################################
3 #
4 # Test that the manpages don't have any syntax errors
5 # as detected by groff.
6 #
7 ######################################################
8
9 . ${MH_TEST_COMMON}
10
11 setup_test
12
13 require_prog groff
14
15 cd ${MH_INST_DIR}${mandir} || exit 1
16
17 # groff will still exit with status zero even if warnings
18 # were emitted, so we have to jump through hoops to
19 # find out if any were emitted.
20
21 expected=$MH_TEST_DIR/$$.expected
22 actual=$MH_TEST_DIR/$$.actual
23
24 # There aren't any expected warnings at the moment but
25 # this mechanism does let us add them if necessary later.
26 rm -f "$expected" "$actual"
27 touch "$expected" "$actual"
28
29 for manpage in man?/*.?; do
30   groff -Tutf8 -mandoc -wmac "$manpage" > /dev/null 2>>"$actual"
31 done
32
33 diff -u "$expected" "$actual"