unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@MIT.EDU>
To: notmuch@notmuchmail.org
Subject: [PATCH 1/3] test: Clear test-ouput output file before running Emacs tests
Date: Sat, 29 Sep 2012 13:55:12 -0400	[thread overview]
Message-ID: <1348941314-8377-2-git-send-email-amdragon@mit.edu> (raw)
In-Reply-To: <1348941314-8377-1-git-send-email-amdragon@mit.edu>

Most Emacs tests end with a call to (test-output), which saves the
buffer to a filed called OUTPUT.  Previously, if the test code failed
with an exception before this call, the test framework would then
compare against the OUTPUT file from the last Emacs test, resulting in
confusing diffs.

This requires one tweak to an emacs test that made two calls to
test_emacs and expected an OUTPUT file from the first call.  We simply
reverse the order of the test_emacs calls.
---
 test/emacs       |    4 ++--
 test/test-lib.sh |    8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/test/emacs b/test/emacs
index 5d118b6..174a9ac 100755
--- a/test/emacs
+++ b/test/emacs
@@ -653,6 +653,8 @@ test_expect_equal "$(cat OUTPUT)" "thread:XXX"
 test_begin_subtest 'notmuch-show-advance-and-archive with invisible signature'
 message1='id:20091118010116.GC25380@dottiness.seas.harvard.edu'
 message2='id:1258491078-29658-1-git-send-email-dottedmag@dottedmag.net'
+test_emacs "(notmuch-show \"$message2\")
+	    (test-output \"EXPECTED\")"
 test_emacs "(notmuch-search \"$message1 or $message2\")
 	    (notmuch-test-wait)
 	    (notmuch-search-show-thread)
@@ -660,8 +662,6 @@ test_emacs "(notmuch-search \"$message1 or $message2\")
 	    (redisplay)
 	    (notmuch-show-advance-and-archive)
 	    (test-output)"
-test_emacs "(notmuch-show \"$message2\")
-	    (test-output \"EXPECTED\")"
 test_expect_equal_file OUTPUT EXPECTED
 
 test_begin_subtest "Refresh show buffer"
diff --git a/test/test-lib.sh b/test/test-lib.sh
index f34b1fb..7448b45 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -985,6 +985,14 @@ test_emacs () {
 		done
 	fi
 
+	# Clear test-output output file.  Most Emacs tests end with a
+	# call to (test-output).  If the test code fails with an
+	# exception before this call, the output file won't get
+	# updated.  Since we don't want to compare against an output
+	# file from another test, so start out with an empty file.
+	rm -f OUTPUT
+	touch OUTPUT
+
 	emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)"
 }
 
-- 
1.7.10

  reply	other threads:[~2012-09-29 17:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-29 17:55 [PATCH 0/3] Fix gnus-inhibit-images bug in Emacs 24 Austin Clements
2012-09-29 17:55 ` Austin Clements [this message]
2012-09-29 17:55 ` [PATCH 2/3] test: Add a test for HTML email with inline images Austin Clements
2012-10-03  9:35   ` Dmitry Kurochkin
2012-10-03 14:28     ` Austin Clements
2012-10-03 14:41       ` Dmitry Kurochkin
2012-09-29 17:55 ` [PATCH 3/3] emacs: Work around gnus-inhibit-images bug in mm-shr Austin Clements
2012-09-29 18:03   ` [PATCH] " Austin Clements
2012-09-29 20:26 ` [PATCH 0/3] Fix gnus-inhibit-images bug in Emacs 24 Tomi Ollila
2012-10-01  2:38   ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348941314-8377-2-git-send-email-amdragon@mit.edu \
    --to=amdragon@mit.edu \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).