From ae2d7ba98958c969073d7ee1cff3f149ad3c8e5e Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 25 Apr 2012 17:40:09 +0200 Subject: [PATCH] futher test suite fixes to work on Solaris (cherry picked from commit a3bf69c3a988b0de2126fbfe6804c61ef24a8896) --- test/common.sh.in | 7 ++++--- test/format/test-mymbox | 2 +- test/inc/test-deb359167 | 2 +- test/inc/test-eom-align | 6 +++--- test/mhparam/test-mhparam | 3 +-- test/post/test-post-common.sh | 5 ++--- test/post/test-post-fcc | 5 ++--- 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/test/common.sh.in b/test/common.sh.in index 58297f0..84d08fc 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -19,6 +19,7 @@ export MH_TEST_DIR auxexecdir bindir mandir sysconfdir pagerpath test -z "$MH_INST_DIR" && MH_INST_DIR=${MH_TEST_DIR}/inst export MH_INST_DIR +unset MHCONTEXT output_md5() { @@ -68,7 +69,7 @@ findprog() require_prog () { - if [ -z `findprog $1` ]; then + if [ -z "`findprog $1`" ]; then test_skip "missing $1" fi } @@ -133,7 +134,7 @@ setup_test () 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 @@ -145,7 +146,7 @@ setup_test () 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 </dev/null; then echo "Somebody's messed with $FILLER -- it must not contain" echo "anything that might look like a message delimiter!" exit 1 @@ -51,8 +51,8 @@ fi # 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 diff --git a/test/mhparam/test-mhparam b/test/mhparam/test-mhparam index 08aff2c..f848277 100755 --- a/test/mhparam/test-mhparam +++ b/test/mhparam/test-mhparam @@ -136,8 +136,7 @@ check $expected $actual 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 diff --git a/test/post/test-post-common.sh b/test/post/test-post-common.sh index e0eaa4a..856c399 100755 --- a/test/post/test-post-common.sh +++ b/test/post/test-post-common.sh @@ -37,9 +37,8 @@ test_post () # 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" } diff --git a/test/post/test-post-fcc b/test/post/test-post-fcc index 159823f..946969c 100755 --- a/test/post/test-post-fcc +++ b/test/post/test-post-fcc @@ -54,9 +54,8 @@ EOF 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}" -- 1.7.10.4