1 Return-Path: <tomi.ollila@iki.fi>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 40346431FBC
\r
6 for <notmuch@notmuchmail.org>; Fri, 24 Jan 2014 10:35:02 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 9AxkDLvvpsJj for <notmuch@notmuchmail.org>;
\r
16 Fri, 24 Jan 2014 10:34:53 -0800 (PST)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id A99A8431FB6
\r
19 for <notmuch@notmuchmail.org>; Fri, 24 Jan 2014 10:34:53 -0800 (PST)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id 346C81000B3;
\r
22 Fri, 24 Jan 2014 20:34:46 +0200 (EET)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
\r
25 Subject: Re: [PATCH] test: make test_emacs call post-command-hook
\r
26 In-Reply-To: <1390578744-30516-1-git-send-email-david@tethera.net>
\r
27 References: <m2lhy5whok.fsf@guru.guru-group.fi>
\r
28 <1390578744-30516-1-git-send-email-david@tethera.net>
\r
29 User-Agent: Notmuch/0.17+41~g8e7fabf (http://notmuchmail.org) Emacs/24.3.1
\r
30 (x86_64-unknown-linux-gnu)
\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
32 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
33 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
34 Date: Fri, 24 Jan 2014 20:34:46 +0200
\r
35 Message-ID: <m21tzxns8p.fsf@guru.guru-group.fi>
\r
37 Content-Type: text/plain
\r
38 X-BeenThere: notmuch@notmuchmail.org
\r
39 X-Mailman-Version: 2.1.13
\r
41 List-Id: "Use and development of the notmuch mail system."
\r
42 <notmuch.notmuchmail.org>
\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
46 List-Post: <mailto:notmuch@notmuchmail.org>
\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
50 X-List-Received-Date: Fri, 24 Jan 2014 18:35:02 -0000
\r
52 On Fri, Jan 24 2014, David Bremner <david@tethera.net> wrote:
\r
54 > From: Mark Walters <markwalters1009@gmail.com>
\r
56 > The unread/read changes will use the post-command-hook. test_emacs
\r
57 > does not call the post-command-hook. This adds a notmuch-test-progn
\r
58 > which takes a list of commands as argument and executes them in turn
\r
59 > but runs the post-command-hook after each one.
\r
61 > The caller can batch operations (ie to stop post-command-hook from
\r
62 > being interleaved) by wrapping the batch of operations inside a progn.
\r
64 > We also explicitly run the post-command-hook before getting the output
\r
65 > from a test; this makes sense as this will be a place the user would
\r
66 > be seeing the information.
\r
69 > OK, OK, so the previous version re-invented prog1. That's the scheme
\r
78 > test/test-lib.el | 11 +++++++++++
\r
79 > test/test-lib.sh | 2 +-
\r
80 > 2 files changed, 12 insertions(+), 1 deletion(-)
\r
82 > diff --git a/test/test-lib.el b/test/test-lib.el
\r
83 > index 37fcb3d..0ee8371 100644
\r
84 > --- a/test/test-lib.el
\r
85 > +++ b/test/test-lib.el
\r
86 > @@ -52,11 +52,13 @@
\r
88 > (defun test-output (&optional filename)
\r
89 > "Save current buffer to file FILENAME. Default FILENAME is OUTPUT."
\r
90 > + (notmuch-post-command)
\r
91 > (write-region (point-min) (point-max) (or filename "OUTPUT")))
\r
93 > (defun test-visible-output (&optional filename)
\r
94 > "Save visible text in current buffer to file FILENAME. Default
\r
95 > FILENAME is OUTPUT."
\r
96 > + (notmuch-post-command)
\r
97 > (let ((text (visible-buffer-string)))
\r
98 > (with-temp-file (or filename "OUTPUT") (insert text))))
\r
100 > @@ -165,3 +167,12 @@ nothing."
\r
103 > (notmuch-test-report-unexpected output expected)))))
\r
105 > +(defun notmuch-post-command ()
\r
106 > + (run-hooks 'post-command-hook))
\r
108 > +(defmacro notmuch-test-progn (&rest body)
\r
111 > + (lambda (x) `(prog1 ,x (notmuch-post-command)))
\r
113 > diff --git a/test/test-lib.sh b/test/test-lib.sh
\r
114 > index 78af170..27dcb59 100644
\r
115 > --- a/test/test-lib.sh
\r
116 > +++ b/test/test-lib.sh
\r
117 > @@ -1118,7 +1118,7 @@ test_emacs () {
\r
121 > - ${TEST_EMACSCLIENT} --socket-name="$EMACS_SERVER" --eval "(progn $@)"
\r
122 > + ${TEST_EMACSCLIENT} --socket-name="$EMACS_SERVER" --eval "(notmuch-test-progn $@)"
\r
129 > _______________________________________________
\r
130 > notmuch mailing list
\r
131 > notmuch@notmuchmail.org
\r
132 > http://notmuchmail.org/mailman/listinfo/notmuch
\r