[PATCH 1/2] test: emacs: call accept-process-output in notmuch-test-wait
Tomi Ollila
tomi.ollila at iki.fi
Sun Aug 5 04:13:01 PDT 2012
notmuch-test-wait called sleep-for in a loop to wait unconditionally 0.1
seconds while waiting for process to exit.
accept-process-output returns as soon as there is any data available
from process, so using it avoids unnecessary fixed delays.
Both of these functions run process sentinels.
---
This 2 patch series is an alternative to
id:"1344122222-14344-1-git-send-email-tomi.ollila at iki.fi"
which speeds up execution when Emacs version is not 23.1.
(so that users of newer emacs doesn't need to suffer the
workaround made for emacs 23.1 users in second patch in
this series)
during testing of the feature I had
+ (accept-process-output nil 10)))
there -- it did not wait 10 seconds.
I also tested the following function:
(defun notmuch-test-wait () t)
i.e. dropping wait altogether -- this makes tests fail in different ways...
test/test-lib.el | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/test-lib.el b/test/test-lib.el
index 5dd6271..52d9936 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -38,7 +38,7 @@
(defun notmuch-test-wait ()
"Wait for process completion."
(while (get-buffer-process (current-buffer))
- (sleep-for 0.1)))
+ (accept-process-output nil 0.1)))
(defun test-output (&optional filename)
"Save current buffer to file FILENAME. Default FILENAME is OUTPUT."
--
1.7.1
More information about the notmuch
mailing list