nmh-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated


From: David Levine
Subject: [Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated. c6bf562d9e823f02fb4a9e6dfb89bf93a0e9d0ab
Date: Sat, 18 Feb 2012 17:21:57 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The nmh Mail Handling System".

The branch, master has been updated
       via  c6bf562d9e823f02fb4a9e6dfb89bf93a0e9d0ab (commit)
      from  67473e912ec0a0849a70cb61d9368c75dae614ee (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/nmh.git/commit/?id=c6bf562d9e823f02fb4a9e6dfb89bf93a0e9d0ab


commit c6bf562d9e823f02fb4a9e6dfb89bf93a0e9d0ab
Author: David Levine <address@hidden>
Date:   Sat Feb 18 11:21:28 2012 -0600

    Have each test clean up after itself if it completes successfully.

diff --git a/test/inc/test-eom-align b/test/inc/test-eom-align
index 2afa100..48c3c01 100755
--- a/test/inc/test-eom-align
+++ b/test/inc/test-eom-align
@@ -29,7 +29,7 @@ fi
 # minor corruptions such as line ending changes could
 # render the tests useless.)
 (cd "$THISDIR" && output_md5 *.txt > "$MH_TEST_DIR/inctest.md5sums")
-diff -u "$THISDIR/md5sums" "$MH_TEST_DIR/inctest.md5sums"
+check "$THISDIR/md5sums" "$MH_TEST_DIR/inctest.md5sums" 'keep first'
 
 FILLER="$THISDIR/filler.txt"
 FROMLINE="$THISDIR/fromline.txt"
@@ -96,10 +96,12 @@ do_one_test_A () {
   $VALGRIND inc -silent -file "$MH_TEST_DIR/eom-align.mbox"
   # We know the messages should be 11 and 12 in inbox
   # Now get the bodies back out.
-  sed -e '1,/^$/d' "$MH_TEST_DIR/Mail/inbox/11" > 
"$MH_TEST_DIR/eom-align.inbox.body1"
-  sed -e '1,/^$/d' "$MH_TEST_DIR/Mail/inbox/12" > 
"$MH_TEST_DIR/eom-align.inbox.body2"
-  diff -u "$MH_TEST_DIR/eom-align.mbox.body" 
"$MH_TEST_DIR/eom-align.inbox.body1"
-  diff -u "$FILLER" "$MH_TEST_DIR/eom-align.inbox.body2"
+  body1="$MH_TEST_DIR/eom-align.inbox.body1"
+  body2="$MH_TEST_DIR/eom-align.inbox.body2"
+  sed -e '1,/^$/d' "$MH_TEST_DIR/Mail/inbox/11" > "$body1"
+  sed -e '1,/^$/d' "$MH_TEST_DIR/Mail/inbox/12" > "$body2"
+  check "$MH_TEST_DIR/eom-align.mbox.body" "$body1" 'keep first'
+  check "$FILLER" "$body2" 'keep first'
   rmm 11 12
 }
 
@@ -110,12 +112,12 @@ do_one_test_B () {
   makembox_B "$MH_TEST_DIR/eom-align.mbox" $STDIO_BUFSZ
   $VALGRIND inc -silent -file "$MH_TEST_DIR/eom-align.mbox"
   # We know the message should be 11 in the inbox
-  sed -e '1,/^$/d' "$MH_TEST_DIR/Mail/inbox/11" > 
"$MH_TEST_DIR/eom-align.inbox.body1"
-  diff -u "$MH_TEST_DIR/eom-align.mbox.body" 
"$MH_TEST_DIR/eom-align.inbox.body1"
+  body1="$MH_TEST_DIR/eom-align.inbox.body1"
+  sed -e '1,/^$/d' "$MH_TEST_DIR/Mail/inbox/11" > "$body1"
+  check "$MH_TEST_DIR/eom-align.mbox.body" "$body1" 'keep first'
   rmm 11
 }
 
-
 # Cover a decent range around the stdio buffer size to make sure we catch
 # any corner cases whether they relate to total message size equal to
 # buffer size or to body size equal to buffer size.
@@ -130,3 +132,8 @@ while test $i -le $FINISH; do
   i=$(expr $i + 1)
 done
 progress_done
+
+test ${failed:-0} -eq 0  &&  \
+rm "$MH_TEST_DIR/eom-align.mbox" "$MH_TEST_DIR/eom-align.mbox.body"
+
+exit $failed
diff --git a/test/manpages/test-manpages b/test/manpages/test-manpages
index fb86c73..4865985 100755
--- a/test/manpages/test-manpages
+++ b/test/manpages/test-manpages
@@ -35,4 +35,6 @@ for manpage in man?/*.?; do
   groff -Tutf8 -mandoc -wmac "$manpage" > /dev/null 2>>"$actual"
 done
 
-diff -u "$expected" "$actual"
+check "$expected" "$actual"
+
+exit $failed
diff --git a/test/mhbuild/test-forw b/test/mhbuild/test-forw
index 22f32df..448a17c 100755
--- a/test/mhbuild/test-forw
+++ b/test/mhbuild/test-forw
@@ -32,9 +32,10 @@ mungedraft() {
     sed 's/\(Content-ID:\) <[^>][^>]*>/\1 <TESTID>/' $draft > $actual
 }
 
-draft=$MH_TEST_DIR/$$.draft
-expected=$MH_TEST_DIR/$$.expected
-actual=$MH_TEST_DIR/$$.actual
+draft="$MH_TEST_DIR/$$.draft"
+draftorig="$MH_TEST_DIR/,$$.draft.orig"
+expected="$MH_TEST_DIR/$$.expected"
+actual="$MH_TEST_DIR/$$.actual"
 
 # check mhbuild
 cat > $expected <<EOF
@@ -73,6 +74,7 @@ mkdraft
 mhbuild $draft
 mungedraft
 check $expected $actual
+test ${failed:-0} -eq 0  &&  rm "$draft" "$draftorig"
 
 # check mhbuild -rfc934
 cat > $expected <<EOF
@@ -110,5 +112,6 @@ mkdraft
 mhbuild -rfc934 $draft
 mungedraft
 check $expected $actual
+test ${failed:-0} -eq 0  &&  rm "$draft" "$draftorig"
 
 exit $failed
diff --git a/test/mhshow/test-cte-binary b/test/mhshow/test-cte-binary
index e2d39f8..b53f1e0 100755
--- a/test/mhshow/test-cte-binary
+++ b/test/mhshow/test-cte-binary
@@ -47,4 +47,7 @@ part       text/plain                  34
 This is a test; this is the body.
 EOF
 mhshow -nopause $msgnum > $actual 2>&1
-diff -u $expected $actual
+check "$expected" "$actual"
+
+exit $failed
+
diff --git a/test/mhshow/test-qp b/test/mhshow/test-qp
index 3d4beb8..12f7f83 100755
--- a/test/mhshow/test-qp
+++ b/test/mhshow/test-qp
@@ -69,4 +69,6 @@ just a newline
 = ^H (backspace) character, probably erased = in diff output
 EOF
 mhshow -nopause $msgnum > $actual 2>&1
-diff -u $expected $actual
+check "$expected" "$actual"
+
+exit $failed
diff --git a/test/mhshow/test-subpart b/test/mhshow/test-subpart
index 6396f62..c2a7262 100755
--- a/test/mhshow/test-subpart
+++ b/test/mhshow/test-subpart
@@ -57,4 +57,6 @@ EOF
 
 # check it
 mhshow -part 1.1 -form mhl.null -nopause $msgnum > $actual 2>&1
-diff -u $expected $actual  &&  rm -f $expected $actual
+check "$expected" "$actual"
+
+exit $failed
diff --git a/test/pick/test-stderr b/test/pick/test-stderr
index e45e13d..0cafe7f 100755
--- a/test/pick/test-stderr
+++ b/test/pick/test-stderr
@@ -29,5 +29,5 @@ EOF
 cat /dev/null > $expected_out
 
 pick -a > $actual_out 2> $actual_err
-diff -u $expected_err $actual_err || exit 1
-diff -u $expected_out $actual_out || exit 1
+check "$expected_err" "$actual_err"
+check "$expected_out" "$actual_out"
diff --git a/test/repl/test-if-str b/test/repl/test-if-str
index 8456df8..327f1c9 100755
--- a/test/repl/test-if-str
+++ b/test/repl/test-if-str
@@ -42,4 +42,8 @@ EOF
 
 repl -editor true -format -form $form -group -nocc me -nowhatnowproc 1 || exit 
1
 
-diff -u $expected $actual
+check "$expected" "$actual"
+
+test ${failed:-0} -eq 0  &&  rm "$form"
+
+exit $failed
diff --git a/test/scan/test-scan b/test/scan/test-scan
index c0408f4..1c6d949 100755
--- a/test/scan/test-scan
+++ b/test/scan/test-scan
@@ -32,4 +32,6 @@ EOF
 
 scan -width 80 +inbox > $actual || exit 1
 
-diff -u $expected $actual
+check "$expected" "$actual"
+
+exit $failed
diff --git a/test/whatnow/test-attach-detach b/test/whatnow/test-attach-detach
index a297273..3ac5f3b 100755
--- a/test/whatnow/test-attach-detach
+++ b/test/whatnow/test-attach-detach
@@ -6,6 +6,8 @@
 #
 ######################################################
 
+set -e
+
 if test -z "${MH_OBJ_DIR}"; then
     srcdir=`dirname "$0"`/../..
     MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
@@ -15,11 +17,10 @@ fi
 
 setup_test
 
-set -e
-
 cd "$MH_TEST_DIR"
-rm -f "baz's boz"
-touch "baz's boz"
+testname="baz's boz"
+testname_quoted="baz\'s\ boz"
+touch "$testname"
 # whatnow's attach stuff needs a draft to work on
 cp "$MH_TEST_DIR/Mail/inbox/1" "$MH_TEST_DIR/Mail/draft"
 
@@ -32,16 +33,22 @@ rm -f $expected $expectederr $actual $actualerr
 touch $expected $expectederr $actual $actualerr
 
 cat > $expected <<EOF
-baz's boz
+$testname
 EOF
 
 # whatnow's exit status is always 1 so that is not a failure
 set +e
-echo "attach baz\\'s\\ boz" | whatnow -attach foo -noedit -prompt '' 2>> 
$actualerr >> $actual
+echo "attach $testname_quoted" | \
+  whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
 echo "alist" | whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
-echo "detach baz\\'s\\ boz" | whatnow -attach foo -noedit -prompt '' 2>> 
$actualerr >> $actual
+echo "detach $testname_quoted" | \
+  whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
 echo "alist" | whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
 set -e
 
-diff -u $expectederr $actualerr || exit 1
-diff -u $expected $actual
+check "$expectederr" "$actualerr"
+check "$expected" "$actual"
+
+test ${failed:-0} -eq 0  &&  rm "$testname"
+
+exit $failed
diff --git a/test/whatnow/test-cd b/test/whatnow/test-cd
index d8feb34..1ff5d96 100755
--- a/test/whatnow/test-cd
+++ b/test/whatnow/test-cd
@@ -6,6 +6,8 @@
 #
 ######################################################
 
+set -e
+
 if test -z "${MH_OBJ_DIR}"; then
     srcdir=`dirname "$0"`/../..
     MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
@@ -15,13 +17,10 @@ fi
 
 setup_test
 
-set -e
 SPDIR="$MH_TEST_DIR/foo's bar"
 rm -rf "$SPDIR"
 mkdir "$SPDIR"
-cd "$SPDIR"
-touch baz boz
-cd
+(cd "$SPDIR"  &&  touch baz boz)
 
 expectederr=$MH_TEST_DIR/$$.expectederr
 actualerr=$MH_TEST_DIR/$$.actualerr
@@ -37,7 +36,12 @@ EOF
 
 # ||true to ignore whatnow's exit status
 # watch the quoting -- shell and printf and then the shell run inside whatnow
-printf "cd $MH_TEST_DIR/foo\\\\'s\\\\ bar\npwd\n" | whatnow -noedit -prompt '' 
2> "$actualerr" > "$actual" || true
+printf "cd $MH_TEST_DIR/foo\\\\'s\\\\ bar\npwd\n" | \
+  whatnow -noedit -prompt '' 2> "$actualerr" > "$actual" || true
+
+check "$expectederr" "$actualerr"
+check "$expected" "$actual"
+
+test ${failed:-0} -eq 0  &&  rm -r "$SPDIR"
 
-diff -u $expectederr $actualerr || exit 1
-diff -u $expected $actual
+exit $failed
diff --git a/test/whatnow/test-ls b/test/whatnow/test-ls
index e3571ac..f212e41 100755
--- a/test/whatnow/test-ls
+++ b/test/whatnow/test-ls
@@ -6,6 +6,8 @@
 #
 ######################################################
 
+set -e
+
 if test -z "${MH_OBJ_DIR}"; then
     srcdir=`dirname "$0"`/../..
     MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
@@ -15,7 +17,6 @@ fi
 
 setup_test
 
-set -e
 SPDIR="$MH_TEST_DIR/foo's bar"
 rm -rf "$SPDIR"
 mkdir "$SPDIR"
@@ -38,5 +39,9 @@ EOF
 # NB use of sort as the order of output of ls is not guaranteed
 echo 'ls' | whatnow -noedit -prompt '' 2> "$actualerr" | sort > "$actual"
 
-diff -u $expectederr $actualerr || exit 1
-diff -u $expected $actual
+check "$expectederr" "$actualerr"
+check "$expected" "$actual"
+
+test ${failed:-0} -eq 0  &&  rm -r "$SPDIR"
+
+exit $failed

-----------------------------------------------------------------------

Summary of changes:
 test/inc/test-eom-align         |   23 +++++++++++++++--------
 test/manpages/test-manpages     |    4 +++-
 test/mhbuild/test-forw          |    9 ++++++---
 test/mhshow/test-cte-binary     |    5 ++++-
 test/mhshow/test-qp             |    4 +++-
 test/mhshow/test-subpart        |    4 +++-
 test/pick/test-stderr           |    4 ++--
 test/repl/test-if-str           |    6 +++++-
 test/scan/test-scan             |    4 +++-
 test/whatnow/test-attach-detach |   25 ++++++++++++++++---------
 test/whatnow/test-cd            |   18 +++++++++++-------
 test/whatnow/test-ls            |   11 ++++++++---
 12 files changed, 79 insertions(+), 38 deletions(-)


hooks/post-receive
-- 
The nmh Mail Handling System



reply via email to

[Prev in Thread] Current Thread [Next in Thread]