]> diplodocus.org Git - nmh/blobdiff - test/manpages/test-manpages
Convert unqp() to decode_qp(), and make it a public function. Also,
[nmh] / test / manpages / test-manpages
index 7cb7db81bec0fa50598e70f22f111551321756f0..315754b2bf5011f29f899c476f7cfa92d9b90ae7 100755 (executable)
@@ -7,8 +7,8 @@
 ######################################################
 
 if test -z "${MH_OBJ_DIR}"; then
 ######################################################
 
 if test -z "${MH_OBJ_DIR}"; then
-    srcdir=`dirname $0`/../..
-    MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR
+    srcdir=`dirname "$0"`/../..
+    MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
 fi
 
 . "$MH_OBJ_DIR/test/common.sh"
 fi
 
 . "$MH_OBJ_DIR/test/common.sh"
@@ -19,7 +19,7 @@ require_prog groff
 
 cd ${MH_INST_DIR}${mandir} || exit 1
 
 
 cd ${MH_INST_DIR}${mandir} || exit 1
 
-# groff will still exit with status zero even if warnings
+# groff will exit with zero status even if warnings
 # were emitted, so we have to jump through hoops to
 # find out if any were emitted.
 
 # were emitted, so we have to jump through hoops to
 # find out if any were emitted.
 
@@ -31,8 +31,28 @@ actual=$MH_TEST_DIR/$$.actual
 rm -f "$expected" "$actual"
 touch "$expected" "$actual"
 
 rm -f "$expected" "$actual"
 touch "$expected" "$actual"
 
+
+warnings="-ww"
+
+#### If the prefix is too long, groff will report that it can't break
+#### the `aliasfiles' line in ali.1.
+length=`echo $prefix | awk '{print length($0)}'`
+[ $length -gt 35 ]  &&  warnings="${warnings} -Wbreak"
+
+#### OpenBSD's mandoc spits out a lot of "unbalance .el request" warnings;
+#### -Wel suppresses them.
+groff -Tutf8 -mandoc -ww man1/ali.1 >/dev/null 2>>"$actual"
+if grep warning "$actual" >/dev/null; then
+  warnings="$warnings -Wel"
+fi
+rm -f "$actual"
+touch "$actual"
+
+
 for manpage in man?/*.?; do
 for manpage in man?/*.?; do
-  groff -Tutf8 -mandoc -wmac "$manpage" > /dev/null 2>>"$actual"
+  groff -Tutf8 -mandoc $warnings "$manpage" >/dev/null 2>>"$actual"
 done
 
 done
 
-diff -u "$expected" "$actual"
+check "$expected" "$actual"
+
+exit $failed