]> diplodocus.org Git - nmh/blobdiff - test/common.sh.in
In InitMultiPart(), always set bogus_mp_content if boundaries
[nmh] / test / common.sh.in
index eb52af68e80a02f204af4a8b0ad79997fead599d..2264d469dd304ede3b58a6ce6e065b50da5bc1a1 100644 (file)
@@ -21,9 +21,13 @@ export MULTIBYTE_ENABLED ICONV_ENABLED
 test -z "$MH_INST_DIR"  &&  MH_INST_DIR="${MH_TEST_DIR}/inst"
 export MH_INST_DIR
 
 test -z "$MH_INST_DIR"  &&  MH_INST_DIR="${MH_TEST_DIR}/inst"
 export MH_INST_DIR
 
-unset MHBUILD MHCONTEXT MHMTSUSERCONF MHN MHSHOW MHSTORE MHTMPDIR
+unset MHBUILD MHCONTEXT MHMTSUSERCONF MHN MHSHOW MHSTORE
 unset MHLDEBUG MHPDEBUG MHWDEBUG MM_CHARSET PAGER
 
 unset MHLDEBUG MHPDEBUG MHWDEBUG MM_CHARSET PAGER
 
+#### Use a test dir for tmp files when MHTMPDIR applies.
+MHTMPDIR=$MH_TEST_DIR/Mail
+export MHTMPDIR
+
 output_md5()
 {
   #### Output just the checksum.  If the filename needs to appear on
 output_md5()
 {
   #### Output just the checksum.  If the filename needs to appear on
@@ -90,7 +94,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'
@@ -163,9 +167,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 +193,14 @@ setup_test ()
         "${MHMTSCONF}.old" >"${MHMTSCONF}"
   fi
 
         "${MHMTSCONF}.old" >"${MHMTSCONF}"
   fi
 
+  #### On Solaris, must set PATH after the install!
+  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
@@ -215,7 +222,6 @@ EOF
     cp "${MH_INST_DIR}${sysconfdir}/${f}" "${MH_TEST_DIR}/Mail" || exit 1
   done
 
     cp "${MH_INST_DIR}${sysconfdir}/${f}" "${MH_TEST_DIR}/Mail" || exit 1
   done
 
-  [ -d ${MH_TEST_DIR}/Mail ]  ||  mkdir ${MH_TEST_DIR}/Mail
   folder -create +inbox > /dev/null
   # create 10 basic messages
   for i in 1 2 3 4 5 6 7 8 9 10;
   folder -create +inbox > /dev/null
   # create 10 basic messages
   for i in 1 2 3 4 5 6 7 8 9 10;