test -z "$MH_INST_DIR" && MH_INST_DIR=${MH_TEST_DIR}/inst
export MH_INST_DIR
+unset MHCONTEXT
output_md5()
{
require_prog ()
{
- if [ -z `findprog $1` ]; then
+ if [ -z "`findprog $1`" ]; then
test_skip "missing $1"
fi
}
MHMTSCONF=${MH_INST_DIR}${sysconfdir}/mts.conf
PATH=${MH_INST_DIR}${bindir}:${PATH}
MH_LIB_DIR=${MH_INST_DIR}${auxexecdir}
- export MH MHMTSCONF MH_LIB_DIR
+ export MH MHMTSCONF MH_LIB_DIR PATH
#
# Only install once
fi
# clean old test data
- trap "rm -rf $MH_TEST_DIR/Mail; exit \$status" 0
+ trap "rm -rf $MH_TEST_DIR/Mail" 0
# setup test data
mkdir $MH_TEST_DIR/Mail || exit 1
cat > $MH <<EOF || exit 1
setup_test
-user=`id -un`
+user=${LOGNAME:-`id -un`}
host=`${MH_OBJ_DIR}/test/getfqdn`
run_test "${MH_LIB_DIR}/ap -format %(mymbox{text}) ${user}" \
THISDIR="$srcdir/test/inc"
TESTMBOX="$THISDIR/deb359167.mbox"
-if [ `output_md5 "$TESTMBOX"` != "e6ac458b8cccba2b2fd866fb505aeb5e" ]; then
+if [ "`output_md5 "$TESTMBOX"`" != "e6ac458b8cccba2b2fd866fb505aeb5e" ]; then
echo "Test mailbox has been corrupted"
exit 1
fi
FROMLINE="$THISDIR/fromline.txt"
HDR="$THISDIR/msgheader.txt"
-if grep -q From "$FILLER"; then
+if grep From "$FILLER" >/dev/null; then
echo "Somebody's messed with $FILLER -- it must not contain"
echo "anything that might look like a message delimiter!"
exit 1
# bigger as well.
STDIO_BUFSZ=16384
-FROMLINESZ=`wc -c "$FROMLINE" | cut -d ' ' -f 1`
-HDRSZ=`wc -c "$HDR" | cut -d ' ' -f 1`
+FROMLINESZ=`wc -c < "$FROMLINE"`
+HDRSZ=`wc -c < "$HDR"`
# makembox_A mboxname sz
# Assemble a mailbox into file mboxname, with two messages, such
run_test 'mhparam faceproc formatproc rmmproc' ''
#### test sbackup separately because it's only passed as a -D compile option
-if mhparam sbackup | grep -F ',
-#' >/dev/null; then
+if mhparam sbackup | grep ',' >/dev/null; then
:
else
echo mhparam sbackup failed
# compare it against our "correct" output.
#
- sed -i.bak -e 's/^Date:.*/Date:/' "$1"
-
- rm -f "${1}.bak"
+ sed -e 's/^Date:.*/Date:/' "$1" > "$1".nodate
+ mv "$1".nodate "$1"
check "$1" "$2"
}
msgname=`mhpath +inbox 11`
-sed -i.bak -e 's/^Date:.*/Date:/' "${msgname}"
-
-rm -f "${msgname}.bak"
+sed -e 's/^Date:.*/Date:/' "${msgname}" > "${msgname}".nodate
+mv "${msgname}".nodate "${msgname}"
check "${testname}.msg.expected" "${msgname}"