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 38955431FD8
\r
6 for <notmuch@notmuchmail.org>; Sat, 14 Dec 2013 15:45:08 -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=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 Yya3LrJQrG+s for <notmuch@notmuchmail.org>;
\r
18 Sat, 14 Dec 2013 15:45:03 -0800 (PST)
\r
19 Received: from mail-we0-f175.google.com (mail-we0-f175.google.com
\r
20 [74.125.82.175]) (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 419B2431FDA
\r
23 for <notmuch@notmuchmail.org>; Sat, 14 Dec 2013 15:44:56 -0800 (PST)
\r
24 Received: by mail-we0-f175.google.com with SMTP id t60so3220031wes.20
\r
25 for <notmuch@notmuchmail.org>; Sat, 14 Dec 2013 15:44:55 -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=VGFoHppb2PupiO9PHS8abdFum/Jxn5E1XqJHuFaDmlnYltqdYpK/xdUinlUenVJ4HI
\r
30 eZKr0l+YXRivrhLtzWt9eR51iI+wdwDiWEE2PqxZx+S7q1QyDs+VrThMdbXj8infKhsb
\r
31 A+9hsSKf6WfI4wNpcWCVUqgENyWQXdrsJ2u62UCNc0EJJvi13P+wRFQ9lcTqo1j1AHYE
\r
32 IicvKV7cKa+u4zcYofO5LVZ06/FOnCmqJKKnCXxjzjVTn9DnVbh1SGHaUfKwfaGmU6rh
\r
33 eTccGEHCaOvT9uo8ojeNSYqq0nmZTCyiXDCeiS5jGcNhM+U/UyRJyY3rVeIi8rRp+NZA
\r
35 X-Received: by 10.180.188.100 with SMTP id fz4mr7977704wic.57.1387064695191;
\r
36 Sat, 14 Dec 2013 15:44:55 -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 w20sm11109685wia.5.2013.12.14.15.44.54
\r
39 for <multiple recipients>
\r
40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
41 Sat, 14 Dec 2013 15:44:54 -0800 (PST)
\r
42 From: Mark Walters <markwalters1009@gmail.com>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH 5/5] test: make test_emacs call post-command-hook
\r
45 Date: Sat, 14 Dec 2013 23:44:36 +0000
\r
46 Message-Id: <1387064676-15508-6-git-send-email-markwalters1009@gmail.com>
\r
47 X-Mailer: git-send-email 1.7.9.1
\r
48 In-Reply-To: <1387064676-15508-1-git-send-email-markwalters1009@gmail.com>
\r
49 References: <1387064676-15508-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:45:08 -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