aboutsummaryrefslogtreecommitdiff
path: root/test/emacs
diff options
context:
space:
mode:
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>2011-06-28 08:56:17 +0400
committerCarl Worth <cworth@cworth.org>2011-06-28 17:10:55 -0700
commita854d06e92645350b7ec3f6cd1a10a2f6933104f (patch)
tree652225103630b0f9af84a90d6a191ea9acd826dd /test/emacs
parent6ea26cfb81c68526b157a213d00b593d4e7b1335 (diff)
test: use emacsclient(1) for Emacs tests
Before the change, every Emacs test ran in a separate Emacs instance. Starting Emacs many times wastes considerable time and it gets worse as the test suite grows. The patch solves this by using a single Emacs server and emacsclient(1) to run multiple tests. Emacs server is started on the first test_emacs call and stopped when test_done is called. We take care not to leave orphan Emacs processes behind when test is terminated by whatever reason: Emacs server runs a watchdog that periodically checks that the test is still running. Some tests need to provide user input. Before the change, this was done using echo(1) to Emacs stdin. This no longer works and instead `standard-input' variable is set accordingly to make `read' return the appropriate string.
Diffstat (limited to 'test/emacs')
-rwxr-xr-xtest/emacs10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/emacs b/test/emacs
index 3034a5a..e59de47 100755
--- a/test/emacs
+++ b/test/emacs
@@ -259,15 +259,15 @@ test_expect_equal_file OUTPUT EXPECTED
test_begin_subtest "Save attachment from within emacs using notmuch-show-save-attachments"
# save as archive to test that Emacs does not re-compress .gz
-echo ./attachment1.gz |
-test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")
- (notmuch-show-save-attachments)' > /dev/null 2>&1
+test_emacs '(let ((standard-input "\"attachment1.gz\""))
+ (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")
+ (notmuch-show-save-attachments))' > /dev/null 2>&1
test_expect_equal_file attachment1.gz "$EXPECTED/attachment"
test_begin_subtest "Save attachment from within emacs using notmuch-show-save-part"
# save as archive to test that Emacs does not re-compress .gz
-echo ./attachment2.gz |
-test_emacs '(notmuch-show-save-part "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com" 5)' > /dev/null 2>&1
+test_emacs '(let ((standard-input "\"attachment2.gz\""))
+ (notmuch-show-save-part "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com" 5))' > /dev/null 2>&1
test_expect_equal_file attachment2.gz "$EXPECTED/attachment"
test_begin_subtest "View raw message within emacs"