]> git.notmuchmail.org Git - notmuch/commit - test/test-lib.el
test: use emacsclient(1) for Emacs tests
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Tue, 28 Jun 2011 04:56:17 +0000 (08:56 +0400)
committerCarl Worth <cworth@cworth.org>
Wed, 29 Jun 2011 00:10:55 +0000 (17:10 -0700)
commita854d06e92645350b7ec3f6cd1a10a2f6933104f
tree652225103630b0f9af84a90d6a191ea9acd826dd
parent6ea26cfb81c68526b157a213d00b593d4e7b1335
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.
test/emacs
test/test-lib.el
test/test-lib.sh