From 360f0c24ea63ed5420365703dd11f72caca0d183 Mon Sep 17 00:00:00 2001 From: David Levine Date: Tue, 13 Mar 2012 22:01:52 -0500 Subject: [PATCH] Changed output_md5() to output just the checksum. If the filename needs to appear on the same line, the caller needs to add it. This avoids differences due to a leading '*' binary file indicator, even for text files, on Cygwin. --- test/common.sh.in | 14 +++++++++----- test/inc/test-deb359167 | 6 +++--- test/inc/test-eom-align | 5 ++++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/test/common.sh.in b/test/common.sh.in index f0545e6..e596fb1 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -21,7 +21,11 @@ export MH_INST_DIR output_md5() { - @MD5SUM@ $* | @MD5FMT@ + #### Output just the checksum. If the filename needs to appear on + #### the same line, the caller needs to add it. This avoids + #### differences due to a leading '*' binary file indicator, for + #### text files, on some platforms (Cygwin). + @MD5SUM@ $* | @MD5FMT@ | cut -d ' ' -f 1 } test_skip () @@ -136,10 +140,10 @@ postproc: ${MH_LIB_DIR}/post EOF for f in MailAliases components digestcomps distcomps forwcomps mhl.body \ - mhl.digest mhl.format mhl.forward mhl.headers mhl.reply \ - mhn.defaults rcvdistcomps replcomps replgroupcomps scan.MMDDYY \ - scan.YYYYMMDD scan.default scan.mailx scan.nomime scan.size \ - scan.time scan.timely scan.unseen + mhl.digest mhl.format mhl.forward mhl.headers mhl.reply \ + mhn.defaults rcvdistcomps replcomps replgroupcomps scan.MMDDYY \ + scan.YYYYMMDD scan.default scan.mailx scan.nomime scan.size \ + scan.time scan.timely scan.unseen do cp ${MH_INST_DIR}${sysconfdir}/${f} ${MH_TEST_DIR}/Mail || exit 1 done diff --git a/test/inc/test-deb359167 b/test/inc/test-deb359167 index af49b87..85e4575 100755 --- a/test/inc/test-deb359167 +++ b/test/inc/test-deb359167 @@ -16,9 +16,9 @@ require_prog valgrind THISDIR="$srcdir/test/inc" TESTMBOX="$THISDIR/deb359167.mbox" -if [ "$(output_md5 "$TESTMBOX" | cut -d ' ' -f 1)" != "e6ac458b8cccba2b2fd866fb505aeb5e" ]; then - echo "Test mailbox has been corrupted" - exit 1 +if [ `output_md5 "$TESTMBOX"` != "e6ac458b8cccba2b2fd866fb505aeb5e" ]; then + echo "Test mailbox has been corrupted" + exit 1 fi # diff --git a/test/inc/test-eom-align b/test/inc/test-eom-align index 48c3c01..5d4b616 100755 --- a/test/inc/test-eom-align +++ b/test/inc/test-eom-align @@ -28,7 +28,10 @@ fi # intact. (Since we're dealing in exact byte alignment # minor corruptions such as line ending changes could # render the tests useless.) -(cd "$THISDIR" && output_md5 *.txt > "$MH_TEST_DIR/inctest.md5sums") +(cd "$THISDIR" && \ + for i in *.txt; do + echo `output_md5 $i`' '"$i" >> "$MH_TEST_DIR/inctest.md5sums" + done) check "$THISDIR/md5sums" "$MH_TEST_DIR/inctest.md5sums" 'keep first' FILLER="$THISDIR/filler.txt" -- 1.7.10.4