]>
diplodocus.org Git - nmh/blob - test/manpages/test-manpages
2 ######################################################
4 # Test that the manpages don't have any syntax errors
5 # as detected by groff.
7 ######################################################
9 if test -z "${MH_OBJ_DIR}"; then
10 srcdir
=`dirname "$0"`/..
/..
11 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
14 .
"$MH_OBJ_DIR/test/common.sh"
20 cd ${MH_INST_DIR}${mandir} || exit 1
22 # groff will still exit with status zero even if warnings
23 # were emitted, so we have to jump through hoops to
24 # find out if any were emitted.
26 expected
=$MH_TEST_DIR/$$.expected
27 actual
=$MH_TEST_DIR/$$.actual
29 # There aren't any expected warnings at the moment but
30 # this mechanism does let us add them if necessary later.
31 rm -f "$expected" "$actual"
32 touch "$expected" "$actual"
34 #### If the prefix is too long, groff will report that it can't break
35 #### the `aliasfiles' line in ali.1.
36 length
=`echo $prefix | awk '{print length($0)}'`
37 [ $length -gt 35 ] && suppress_break_warning
=-Wbreak
39 warnings
="-ww $suppress_break_warning"
41 for manpage
in man?
/*.?
; do
42 groff -Tutf8 -mandoc $warnings "$manpage" > /dev
/null
2>>"$actual"
45 check
"$expected" "$actual"