* test/runtest, test/tests/inc/test-deb359167,
[mmh] / test / tests / 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 require_prog groff
12
13 cd $MH_TEST_DIR/share/man
14
15 # groff will still exit with status zero even if warnings
16 # were emitted, so we have to jump through hoops to
17 # find out if any were emitted.
18
19 expected=$MH_TEST_DIR/$$.expected
20 actual=$MH_TEST_DIR/$$.actual
21
22 # There aren't any expected warnings at the moment but
23 # this mechanism does let us add them if necessary later.
24 rm -f "$expected" "$actual"
25 touch "$expected" "$actual"
26
27 for manpage in man?/*.?; do
28   groff -Tutf8 -mandoc -wmac "$manpage" > /dev/null 2>>"$actual"
29 done
30
31 diff -u "$expected" "$actual"