1 Return-Path: <markwalters1009@gmail.com>
\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 360E5431FDE
\r
6 for <notmuch@notmuchmail.org>; Sat, 14 Dec 2013 15:53:40 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,
\r
14 RCVD_IN_DNSWL_LOW=-0.7] autolearn=unavailable
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id c0RVyKP4VTCA for <notmuch@notmuchmail.org>;
\r
18 Sat, 14 Dec 2013 15:53:40 -0800 (PST)
\r
19 Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com
\r
20 [209.85.212.180]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id D01E9431FD7
\r
23 for <notmuch@notmuchmail.org>; Sat, 14 Dec 2013 15:53:34 -0800 (PST)
\r
24 Received: by mail-wi0-f180.google.com with SMTP id hn9so732772wib.1
\r
25 for <notmuch@notmuchmail.org>; Sat, 14 Dec 2013 15:53:33 -0800 (PST)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:in-reply-to:references;
\r
28 bh=+efGbVtifOD5XXoCSmyTsITT1MQwKHo3bAWLFVvq/tM=;
\r
29 b=kz9EySK29SS9e7BOE+XiPLeCILpKBHfNF9Gkl1qajXwUS4NH0mmZQluXr0Co8NaMNi
\r
30 jEZXwTXklRpYeWrb3+5nqq3X0gJo8AhrTx724BY2nzPotxNnS+lVyuUwIqkUhflo7Kwf
\r
31 HsenjyoUyS8dLnSshkOq8myZxxFfZHcJIMC3cECRinDjgaV457vZMYPw4wv3PQFJuhIB
\r
32 ZABV5bCmpizLzd13bUjfSnnfqK+GUX98Zzrx7FxqTmUVxdDVw1CEshtWiKsGOm74RsRr
\r
33 Svv5ZtbqdA9qWAvGWymEarHl+I9euCHjbMkckEbgg3H6vLtCnFNoQERK9wQ/lyDPguVM
\r
35 X-Received: by 10.194.109.68 with SMTP id hq4mr7856797wjb.12.1387065213749;
\r
36 Sat, 14 Dec 2013 15:53:33 -0800 (PST)
\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])
\r
38 by mx.google.com with ESMTPSA id
\r
39 mz10sm11180290wic.2.2013.12.14.15.53.32 for <multiple recipients>
\r
40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
41 Sat, 14 Dec 2013 15:53:33 -0800 (PST)
\r
42 From: Mark Walters <markwalters1009@gmail.com>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH v2 1/5] test: make test_emacs call post-command-hook
\r
45 Date: Sat, 14 Dec 2013 23:53:13 +0000
\r
46 Message-Id: <1387065197-15776-2-git-send-email-markwalters1009@gmail.com>
\r
47 X-Mailer: git-send-email 1.7.9.1
\r
48 In-Reply-To: <1387065197-15776-1-git-send-email-markwalters1009@gmail.com>
\r
49 References: <1387065197-15776-1-git-send-email-markwalters1009@gmail.com>
\r
50 X-BeenThere: notmuch@notmuchmail.org
\r
51 X-Mailman-Version: 2.1.13
\r
53 List-Id: "Use and development of the notmuch mail system."
\r
54 <notmuch.notmuchmail.org>
\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
58 List-Post: <mailto:notmuch@notmuchmail.org>
\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
62 X-List-Received-Date: Sat, 14 Dec 2013 23:53:40 -0000
\r
64 The unread/read changes will use the post-command-hook. test_emacs
\r
65 does not call the post-command-hook. This adds a notmuch-test-progn
\r
66 which takes a list of commands as argument and executes them in turn
\r
67 but runs the post-command-hook after each one.
\r
69 The caller can batch operations (ie to stop post-command-hook from
\r
70 being interleaved) by wrapping the batch of operations inside a progn.
\r
72 We also explicitly run the post-command-hook before getting the output
\r
73 from a test; this makes sense as this will be a place the user would
\r
74 be seeing the information.
\r
76 test/test-lib.el | 12 ++++++++++++
\r
77 test/test-lib.sh | 2 +-
\r
78 2 files changed, 13 insertions(+), 1 deletions(-)
\r
80 diff --git a/test/test-lib.el b/test/test-lib.el
\r
81 index d26b49f..1c9e224 100644
\r
82 --- a/test/test-lib.el
\r
83 +++ b/test/test-lib.el
\r
86 (defun test-output (&optional filename)
\r
87 "Save current buffer to file FILENAME. Default FILENAME is OUTPUT."
\r
88 + (notmuch-post-command)
\r
89 (write-region (point-min) (point-max) (or filename "OUTPUT")))
\r
91 (defun test-visible-output (&optional filename)
\r
92 "Save visible text in current buffer to file FILENAME. Default
\r
93 FILENAME is OUTPUT."
\r
94 + (notmuch-post-command)
\r
95 (let ((text (visible-buffer-string)))
\r
96 (with-temp-file (or filename "OUTPUT") (insert text))))
\r
98 @@ -162,3 +164,13 @@ nothing."
\r
101 (notmuch-test-report-unexpected output expected)))))
\r
103 +(defun notmuch-post-command ()
\r
104 + (run-hooks 'post-command-hook))
\r
106 +(defun notmuch-test-progn (body)
\r
109 + (dolist (form body ret)
\r
110 + (setq ret (eval form))
\r
111 + (notmuch-post-command))))
\r
112 diff --git a/test/test-lib.sh b/test/test-lib.sh
\r
113 index d8e0d91..e7833fc 100644
\r
114 --- a/test/test-lib.sh
\r
115 +++ b/test/test-lib.sh
\r
116 @@ -1075,7 +1075,7 @@ test_emacs () {
\r
120 - ${TEST_EMACSCLIENT} --socket-name="$EMACS_SERVER" --eval "(progn $@)"
\r
121 + ${TEST_EMACSCLIENT} --socket-name="$EMACS_SERVER" --eval "(notmuch-test-progn '($@))"
\r