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 CF530431FD4
\r
6 for <notmuch@notmuchmail.org>; Tue, 25 Mar 2014 13:03:33 -0700 (PDT)
\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=disabled
\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 9tixTp3LZm1y for <notmuch@notmuchmail.org>;
\r
18 Tue, 25 Mar 2014 13:03:29 -0700 (PDT)
\r
19 Received: from mail-we0-f180.google.com (mail-we0-f180.google.com
\r
20 [74.125.82.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 02557431FC2
\r
23 for <notmuch@notmuchmail.org>; Tue, 25 Mar 2014 13:03:28 -0700 (PDT)
\r
24 Received: by mail-we0-f180.google.com with SMTP id p61so696471wes.11
\r
25 for <notmuch@notmuchmail.org>; Tue, 25 Mar 2014 13:03:27 -0700 (PDT)
\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=K2IF/+hfJBbwhIAhHdEDx1DdAEOD0dVeR/XD/W1urMQ=;
\r
29 b=0FVL9rsiUm34iUQ+NprYytuTriu269wnpmqP0dBCEgosIr7fQ33KfMRTLsVCdvBLwz
\r
30 f69Xi/2+cR0Rqr8Szb/t5VdJCHl6UFnGsW7DWCYYMFquMCDUgF1kCFpa1qwTiUSn+3AV
\r
31 SpByiFzVxSS8KAfEvuvtBkOhC3ClKmDYTGha4cpv4vI2RrzQ+72BdPvS8KI2OuusGOAQ
\r
32 agMuoHUceWCArtiaf3Mxo2PzeD21aOLVba5TkkeNgID++mWU6l3S/d7PHl5OY8wCsYU8
\r
33 /i7u6GTTaaiv6QG52mh9ppu1OljcFhkUjJPFj+QUloFled/Z9pSzOxk60JcrrVvbNNYf
\r
35 X-Received: by 10.180.165.238 with SMTP id zb14mr25915148wib.51.1395777799348;
\r
36 Tue, 25 Mar 2014 13:03:19 -0700 (PDT)
\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 dd5sm984658wib.12.2014.03.25.13.03.18
\r
39 for <multiple recipients>
\r
40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
41 Tue, 25 Mar 2014 13:03:18 -0700 (PDT)
\r
42 From: Mark Walters <markwalters1009@gmail.com>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [Patch v3 1/3] test: make test_emacs call post-command-hook
\r
45 Date: Tue, 25 Mar 2014 20:03:11 +0000
\r
46 Message-Id: <1395777793-13297-2-git-send-email-markwalters1009@gmail.com>
\r
47 X-Mailer: git-send-email 1.7.10.4
\r
48 In-Reply-To: <1395777793-13297-1-git-send-email-markwalters1009@gmail.com>
\r
49 References: <1395777793-13297-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: Tue, 25 Mar 2014 20:03:34 -0000
\r
64 From: David Bremner <david@tethera.net>
\r
66 The unread/read changes will use the post-command-hook. test_emacs
\r
67 does not call the post-command-hook. This adds a notmuch-test-progn
\r
68 which takes a list of commands as argument and executes them in turn
\r
69 but runs the post-command-hook after each one.
\r
71 The caller can batch operations (ie to stop post-command-hook from
\r
72 being interleaved) by wrapping the batch of operations inside a progn.
\r
74 We also explicitly run the post-command-hook before getting the output
\r
75 from a test; this makes sense as this will be a place the user would
\r
76 be seeing the information.
\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 437f83f..36afe63 100644
\r
84 --- a/test/test-lib.el
\r
85 +++ b/test/test-lib.el
\r
86 @@ -52,11 +52,13 @@ (defun notmuch-test-wait ()
\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 @@ -166,6 +168,15 @@ (defun notmuch-test-expect-equal (output expected)
\r
102 (notmuch-test-report-unexpected output expected)))))
\r
104 +(defun notmuch-post-command ()
\r
105 + (run-hooks 'post-command-hook))
\r
107 +(defmacro notmuch-test-progn (&rest body)
\r
110 + (lambda (x) `(prog1 ,x (notmuch-post-command)))
\r
113 ;; For historical reasons, we hide deleted tags by default in the test
\r
115 (setq notmuch-tag-deleted-formats
\r
116 diff --git a/test/test-lib.sh b/test/test-lib.sh
\r
117 index 8697d6a..e6403e5 100644
\r
118 --- a/test/test-lib.sh
\r
119 +++ b/test/test-lib.sh
\r
120 @@ -1139,7 +1139,7 @@ test_emacs () {
\r
124 - ${TEST_EMACSCLIENT} --socket-name="$EMACS_SERVER" --eval "(progn $@)"
\r
125 + ${TEST_EMACSCLIENT} --socket-name="$EMACS_SERVER" --eval "(notmuch-test-progn $@)"
\r