/config.h
/config.log
/config.status
+/test/common.sh
/stamp-h1
# Removed by clean:
## And it would be easier to clean up if tests were launched from a
## tmp directory, and/or each test cleaned up after itself on
## successful completion.
-MOSTLYCLEANFILES = test/testinstall/*.actual* test/testinstall/*.expected* \
- test/testinstall/*.replgroupcomps test/testinstall/*.draft \
- test/testinstall/,*.draft* \*
+##MOSTLYCLEANFILES = test/testinstall/*.actual* test/testinstall/*.expected* \
+## test/testinstall/*.replgroupcomps test/testinstall/*.draft \
+## test/testinstall/,*.draft*
+
+mostlyclean-local:
+ rm -rf test/testinstall
+ rm -rf test/testbuild
##
## Stuff that should be cleaned via "make clean"
man/rcvpack.man man/rcvstore.man man/rcvtty.man man/refile.man \
man/repl.man man/rmf.man man/rmm.man man/scan.man man/send.man \
man/sendfiles.man man/show.man man/slocal.man man/sortm.man \
- man/unseen.man man/whatnow.man man/whom.man
+ man/unseen.man man/whatnow.man man/whom.man test/common.sh.in \
+ test/README test/runalltests test/runtest test/setup-test \
+ test/teardown-test test/tests
##
## These are all of the definitions for each of the programs listed above.
dnl Look for `cut'
pathtmp=/usr/bin:/bin:/usr/local/bin:/usr/xpg4/bin:/usr/ucb
-AC_PATH_PROG(cutpath, cut, no, [$pathtmp])
+AC_PATH_PROG([cutpath], [cut], [no], [$pathtmp])
+
+dnl
+dnl Check for MD5 program and formatting command
+dnl
+AC_CHECK_PROGS([MD5SUM], [md5sum md5], [missing])
+AS_CASE(["${MD5SUM}"],
+ [md5sum], [MD5FMT="cat"],
+ [md5], [[MD5FMT="${SED} -e 's/MD5 *(\(.*\)) *= \([0-9a-f]*\)/\2 \1/'"]],
+ [MD5FMT="missing"])
+AC_SUBST([MD5FMT])
dnl ----------------------------------------------
dnl check for lclint, and lint if it doesn't exist
dnl ---------------
dnl OUTPUT MAKEFILE
dnl ---------------
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile test/common.sh])
AC_OUTPUT
# Common helper routines for test shell scripts -- intended to be sourced by them
+
+output_md5()
+{
+ @MD5SUM@ $* | @MD5FMT@
+}
+
test_skip ()
{
WHY="$1"
echo "Path: $MH_TEST_DIR/Mail" > $MH
folder -create +inbox > /dev/null
# create 10 basic messages
-for i in `seq 1 10`;
+for i in 1 2 3 4 5 6 7 8 9 10;
do
cat > $MH_TEST_DIR/Mail/inbox/$i <<EOF
From: Test$i <test$i@example.com>
# indicates test was skipped (eg needed program not found)
# test itself should have printed a message about this,
# so print nothing here.
- :
+ status=0
else
echo Test $1 FAIL
fi
TESTMBOX="$THISDIR/deb359167.mbox"
-if [ "$(md5sum "$TESTMBOX" | cut -d ' ' -f 1)" != "e6ac458b8cccba2b2fd866fb505aeb5e" ]; then
+if [ "$(${MD5SUM} "$TESTMBOX" | cut -d ' ' -f 1)" != "e6ac458b8cccba2b2fd866fb505aeb5e" ]; then
echo "Test mailbox has been corrupted"
exit 1
fi
# intact. (Since we're dealing in exact byte alignment
# minor corruptions such as line ending changes could
# render the tests useless.)
-(cd "$THISDIR" && md5sum *.txt > "$MH_TEST_DIR/inctest.md5sums")
+(cd "$THISDIR" && output_md5 *.txt > "$MH_TEST_DIR/inctest.md5sums")
diff -u "$THISDIR/md5sums" "$MH_TEST_DIR/inctest.md5sums"
FILLER="$THISDIR/filler.txt"
START=$(($STDIO_BUFSZ - 16))
FINISH=$(($STDIO_BUFSZ + $HDRSZ + $FROMLINESZ + 32))
echo "Testing inc of files with various alignments of eom marker with buffer size..."
-for sz in $(seq $START $FINISH); do
+i="$START"
+while test $i -le $FINISH; do
progress_update $sz $START $FINISH
do_one_test_A $sz
do_one_test_B $sz
+ i=$(expr $i + 1)
done
progress_done