]> diplodocus.org Git - nmh/blobdiff - test/common.sh.in
Rework multibyte test so it will calculate the width of all of the
[nmh] / test / common.sh.in
index 5a5a223b57148f896dfa8b3175c25b80fcc67c1a..a117d6fe11729cace35c6a23dc5b814bebe58d18 100644 (file)
@@ -90,7 +90,7 @@ if [ -t 1 ] ; then
     # note \r so next update will overwrite
     printf '%3d%%\r' $PERC
   }
     # note \r so next update will overwrite
     printf '%3d%%\r' $PERC
   }
-  
+
   progress_done ()
   {
     printf '100%%\n'
   progress_done ()
   {
     printf '100%%\n'
@@ -134,7 +134,7 @@ check() {
       rm -f "$2"
     else
       echo
       rm -f "$2"
     else
       echo
-      diff -c "$1" "$2"
+      diff -c "$1" "$2" || true
       echo
       echo "$0: test failed, outputs are in $1 and $2."
       failed=`expr ${failed:-0} + 1`
       echo
       echo "$0: test failed, outputs are in $1 and $2."
       failed=`expr ${failed:-0} + 1`
@@ -163,9 +163,8 @@ setup_test ()
 {
   MH="${MH_TEST_DIR}/Mail/.mh_profile"
   MHMTSCONF="${MH_INST_DIR}${sysconfdir}/mts.conf"
 {
   MH="${MH_TEST_DIR}/Mail/.mh_profile"
   MHMTSCONF="${MH_INST_DIR}${sysconfdir}/mts.conf"
-  PATH="${MH_INST_DIR}${bindir}:${PATH}"
   MH_LIB_DIR="${MH_INST_DIR}${auxexecdir}"
   MH_LIB_DIR="${MH_INST_DIR}${auxexecdir}"
-  export MH MHMTSCONF MH_LIB_DIR PATH
+  export MH MHMTSCONF MH_LIB_DIR
 
   #
   # Only install once
 
   #
   # Only install once
@@ -190,10 +189,13 @@ setup_test ()
         "${MHMTSCONF}.old" >"${MHMTSCONF}"
   fi
 
         "${MHMTSCONF}.old" >"${MHMTSCONF}"
   fi
 
+  PATH="${MH_INST_DIR}${bindir}:${PATH}"
+  export PATH
+
   # clean old test data
   trap "rm -rf '$MH_TEST_DIR/Mail'" 0
   # setup test data
   # clean old test data
   trap "rm -rf '$MH_TEST_DIR/Mail'" 0
   # setup test data
-  mkdir "$MH_TEST_DIR/Mail" || exit 1
+  mkdir -p "$MH_TEST_DIR/Mail" || exit 1
   cat > "$MH" <<EOF || exit 1
 Path: ${MH_TEST_DIR}/Mail
 buildmimeproc: ${MH_INST_DIR}${bindir}/mhbuild
   cat > "$MH" <<EOF || exit 1
 Path: ${MH_TEST_DIR}/Mail
 buildmimeproc: ${MH_INST_DIR}${bindir}/mhbuild