1 Return-Path: <bremner@tesseract.cs.unb.ca>
\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 A479B431FBC
\r
6 for <notmuch@notmuchmail.org>; Sat, 18 Oct 2014 00:22:54 -0700 (PDT)
\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 v-9I-8xYx1Is for <notmuch@notmuchmail.org>;
\r
16 Sat, 18 Oct 2014 00:22:49 -0700 (PDT)
\r
17 Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])
\r
18 (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 27EAE431FB6
\r
21 for <notmuch@notmuchmail.org>; Sat, 18 Oct 2014 00:22:49 -0700 (PDT)
\r
22 Received: from remotemail by yantan.tethera.net with local (Exim 4.80)
\r
23 (envelope-from <bremner@tesseract.cs.unb.ca>)
\r
24 id 1XfOLg-0001X3-Om; Sat, 18 Oct 2014 04:22:48 -0300
\r
25 Received: (nullmailer pid 27657 invoked by uid 1000); Sat, 18 Oct 2014
\r
27 From: David Bremner <david@tethera.net>
\r
28 To: notmuch@notmuchmail.org
\r
29 Subject: [PATCH] test: add simple tests for post-insert hook
\r
30 Date: Sat, 18 Oct 2014 09:22:35 +0200
\r
31 Message-Id: <1413616955-27612-1-git-send-email-david@tethera.net>
\r
32 X-Mailer: git-send-email 2.1.1
\r
34 <27c7ada91f96deda6e51732e0397bffd2ef2ab42.1411914914.git.jani@nikula.org>
\r
36 <27c7ada91f96deda6e51732e0397bffd2ef2ab42.1411914914.git.jani@nikula.org>
\r
37 X-BeenThere: notmuch@notmuchmail.org
\r
38 X-Mailman-Version: 2.1.13
\r
40 List-Id: "Use and development of the notmuch mail system."
\r
41 <notmuch.notmuchmail.org>
\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
43 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
45 List-Post: <mailto:notmuch@notmuchmail.org>
\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
49 X-List-Received-Date: Sat, 18 Oct 2014 07:22:54 -0000
\r
51 Most of the existing tests for pre/post-new hook don't seem to apply.
\r
53 test/T400-hooks.sh | 18 ++++++++++++++++++
\r
54 1 file changed, 18 insertions(+)
\r
56 diff --git a/test/T400-hooks.sh b/test/T400-hooks.sh
\r
57 index 77e8569..e741211 100755
\r
58 --- a/test/T400-hooks.sh
\r
59 +++ b/test/T400-hooks.sh
\r
60 @@ -30,6 +30,8 @@ rm_hooks () {
\r
62 # add a message to generate mail dir and database
\r
64 +# create maildir structure for notmuch-insert
\r
65 +mkdir -p "$MAIL_DIR"/{cur,new,tmp}
\r
67 test_begin_subtest "pre-new is run"
\r
69 @@ -45,6 +47,16 @@ create_echo_hook "post-new" expected output
\r
70 notmuch new > /dev/null
\r
71 test_expect_equal_file expected output
\r
73 +test_begin_subtest "post-insert hook is run"
\r
76 +create_echo_hook "post-insert" expected output
\r
77 +echo $gen_msg_filename
\r
79 +notmuch insert < "$gen_msg_filename"
\r
81 +test_expect_equal_file expected output
\r
83 test_begin_subtest "pre-new is run before post-new"
\r
86 @@ -82,6 +94,12 @@ test_expect_equal_file expected output
\r
87 # depends on the previous subtest leaving broken hook behind
\r
88 test_expect_code 1 "post-new non-zero exit status (notmuch status)" "notmuch new"
\r
92 +create_failing_hook "post-insert"
\r
93 +test_expect_success "post-insert hook does not affect insert status" \
\r
94 + "notmuch insert < \"$gen_msg_filename\" > /dev/null"
\r
96 # test_begin_subtest "hook without executable permissions"
\r
98 mkdir -p ${HOOK_DIR}
\r