Re: [PATCH] configure: add help note about gmime version
[notmuch-archives.git] / 1a / b13c31b6f9b95a99d31cdee552b860e2167605
1 Return-Path: <dme@dme.org>\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 1B2B0429E3B\r
6         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 06:07:12 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 B3QdYIXy7dk2 for <notmuch@notmuchmail.org>;\r
16         Tue, 17 Jan 2012 06:07:11 -0800 (PST)\r
17 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
18  [74.125.82.45])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
19  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
20  5B378429E2F    for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 06:07:11 -0800\r
21  (PST)\r
22 Received: by wgbdr13 with SMTP id dr13so1279238wgb.2\r
23         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 06:07:10 -0800 (PST)\r
24 Received: by 10.180.104.4 with SMTP id ga4mr15054133wib.17.1326809230150;\r
25         Tue, 17 Jan 2012 06:07:10 -0800 (PST)\r
26 Received: from hotblack-desiato.hh.sledj.net\r
27         (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])\r
28         by mx.google.com with ESMTPS id g12sm44386773wiw.10.2012.01.17.06.07.06\r
29         (version=TLSv1/SSLv3 cipher=OTHER);\r
30         Tue, 17 Jan 2012 06:07:08 -0800 (PST)\r
31 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
32         id 9F6ABA04F3; Tue, 17 Jan 2012 14:07:05 +0000 (GMT)\r
33 From: David Edmondson <dme@dme.org>\r
34 To: notmuch@notmuchmail.org\r
35 Subject: [PATCH 2/3] test: Add `test_emacs_expect_t'.\r
36 Date: Tue, 17 Jan 2012 14:07:03 +0000\r
37 Message-Id: <1326809224-22673-2-git-send-email-dme@dme.org>\r
38 X-Mailer: git-send-email 1.7.7.3\r
39 In-Reply-To: <1326809224-22673-1-git-send-email-dme@dme.org>\r
40 References: <87pqei327k.fsf@gmail.com>\r
41         <1326809224-22673-1-git-send-email-dme@dme.org>\r
42 X-BeenThere: notmuch@notmuchmail.org\r
43 X-Mailman-Version: 2.1.13\r
44 Precedence: list\r
45 List-Id: "Use and development of the notmuch mail system."\r
46         <notmuch.notmuchmail.org>\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
50 List-Post: <mailto:notmuch@notmuchmail.org>\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
54 X-List-Received-Date: Tue, 17 Jan 2012 14:07:12 -0000\r
55 \r
56 Add a new test function to allow simpler testing of emacs\r
57 functionality.\r
58 \r
59 `test_emacs_expect_t' takes one argument - a list expression to\r
60 evaluate. The test passes if the expression returns `t', otherwise it\r
61 fails and the output is reported to the tester.\r
62 ---\r
63 \r
64 Re-worked as Dmitry suggested.\r
65 \r
66  test/README                  |    8 ++++++++\r
67  test/emacs-test-functions.sh |    9 +++++++++\r
68  test/notmuch-test            |    1 +\r
69  test/test-lib.sh             |   33 +++++++++++++++++++++++++++++++++\r
70  4 files changed, 51 insertions(+), 0 deletions(-)\r
71  create mode 100755 test/emacs-test-functions.sh\r
72 \r
73 diff --git a/test/README b/test/README\r
74 index bde6db0..9dbe2ee 100644\r
75 --- a/test/README\r
76 +++ b/test/README\r
77 @@ -189,6 +189,14 @@ library for your script to use.\r
78     tests that may run in the same Emacs instance.  Use `let' instead\r
79     so the scope of the changed variables is limited to a single test.\r
80  \r
81 + test_emacs_expect_t <emacs-lisp-expressions>\r
82 +\r
83 +  This function executes the provided emacs lisp script within\r
84 +  emacs in a manner similar to 'test_emacs'. The expressions should\r
85 +  return the value `t' to indicate that the test has passed. If the\r
86 +  test does not return `t' then it is considered failed and all data\r
87 +  returned by the test is reported to the tester.\r
88 +\r
89   test_done\r
90  \r
91     Your test script must have test_done at the end.  Its purpose\r
92 diff --git a/test/emacs-test-functions.sh b/test/emacs-test-functions.sh\r
93 new file mode 100755\r
94 index 0000000..0e1f9fc\r
95 --- /dev/null\r
96 +++ b/test/emacs-test-functions.sh\r
97 @@ -0,0 +1,9 @@\r
98 +#!/usr/bin/env bash\r
99 +\r
100 +test_description="emacs test function sanity"\r
101 +. test-lib.sh\r
102 +\r
103 +test_begin_subtest "emacs test function sanity"\r
104 +test_emacs_expect_t 't'\r
105 +\r
106 +test_done\r
107 diff --git a/test/notmuch-test b/test/notmuch-test\r
108 index 6a99ae3..d034f99 100755\r
109 --- a/test/notmuch-test\r
110 +++ b/test/notmuch-test\r
111 @@ -52,6 +52,7 @@ TESTS="\r
112    python\r
113    hooks\r
114    argument-parsing\r
115 +  emacs-test-functions.sh\r
116  "\r
117  TESTS=${NOTMUCH_TESTS:=$TESTS}\r
118  \r
119 diff --git a/test/test-lib.sh b/test/test-lib.sh\r
120 index 7c9ce24..4b05760 100644\r
121 --- a/test/test-lib.sh\r
122 +++ b/test/test-lib.sh\r
123 @@ -503,6 +503,39 @@ test_expect_equal_file ()\r
124      fi\r
125  }\r
126  \r
127 +test_emacs_expect_t () {\r
128 +       test "$#" = 1 || error "bug in the test script: not 1 parameter to test_emacs_expect_t"\r
129 +\r
130 +       # Run the test.\r
131 +       if ! test_skip "$test_subtest_name"\r
132 +       then\r
133 +               # We cannot call 'test_emacs' in a subshell, because\r
134 +               # the setting of EMACS_SERVER would not persist\r
135 +               # throughout a sequence of tests, so we use a\r
136 +               # temporary file.\r
137 +               tmp="$TMPDIR"; if [ -z "$tmp" ]; then tmp=/tmp; fi\r
138 +               output="$tmp/test_emacs_output.$$"\r
139 +               test_emacs "$1" > "${output}"\r
140 +               result=$(cat "${output}")\r
141 +               rm -f "${output}"\r
142 +       fi\r
143 +\r
144 +       # Restore state after the test.\r
145 +       exec 1>&6 2>&7          # Restore stdout and stderr\r
146 +       inside_subtest=\r
147 +\r
148 +       # Report success/failure.\r
149 +       if ! test_skip "$test_subtest_name"\r
150 +       then\r
151 +               if [ "$result" == t ]\r
152 +               then\r
153 +                       test_ok_ "$test_subtest_name"\r
154 +               else\r
155 +                       test_failure_ "$test_subtest_name" "$(eval printf ${result})"\r
156 +               fi\r
157 +       fi\r
158 +}\r
159 +\r
160  NOTMUCH_NEW ()\r
161  {\r
162      notmuch new | grep -v -E -e '^Processed [0-9]*( total)? file|Found [0-9]* total file'\r
163 -- \r
164 1.7.7.3\r
165 \r