Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 7c / e002eb78e11abfd8fc0b8589aa4ac74a4a5979
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 83B40429E5A\r
6         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 04:52:47 -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 Exa-XGbmLHQA for <notmuch@notmuchmail.org>;\r
16         Tue, 17 Jan 2012 04:52:47 -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  BE485429E2F    for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 04:52:46 -0800\r
21  (PST)\r
22 Received: by wgbdr13 with SMTP id dr13so1204929wgb.2\r
23         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 04:52:45 -0800 (PST)\r
24 Received: by 10.180.81.66 with SMTP id y2mr9399704wix.20.1326804765343;\r
25         Tue, 17 Jan 2012 04:52:45 -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 l2sm31292557wie.11.2012.01.17.04.52.43\r
29         (version=TLSv1/SSLv3 cipher=OTHER);\r
30         Tue, 17 Jan 2012 04:52:43 -0800 (PST)\r
31 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
32         id 036369FCDD; Tue, 17 Jan 2012 12:52:42 +0000 (GMT)\r
33 From: David Edmondson <dme@dme.org>\r
34 To: notmuch@notmuchmail.org\r
35 Subject: [PATCH 1/4] test: Add `test_emacs_expect_t'.\r
36 Date: Tue, 17 Jan 2012 12:52:25 +0000\r
37 Message-Id: <1326804748-8989-2-git-send-email-dme@dme.org>\r
38 X-Mailer: git-send-email 1.7.7.3\r
39 In-Reply-To: <1326804748-8989-1-git-send-email-dme@dme.org>\r
40 References: <1326804748-8989-1-git-send-email-dme@dme.org>\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Tue, 17 Jan 2012 12:52:47 -0000\r
54 \r
55 Add a new test function to allow simpler testing of emacs\r
56 functionality.\r
57 \r
58 `test_emacs_expect_t' takes two arguments:\r
59   - the name of the test,\r
60   - some lisp to evaluate.\r
61 \r
62 The test passes if the lisp returns `t', otherwise it fails and the\r
63 output is reported to the tester.\r
64 ---\r
65  test/emacs-test-functions.sh |    8 ++++++++\r
66  test/notmuch-test            |    1 +\r
67  test/test-lib.sh             |   24 ++++++++++++++++++++++++\r
68  3 files changed, 33 insertions(+), 0 deletions(-)\r
69  create mode 100755 test/emacs-test-functions.sh\r
70 \r
71 diff --git a/test/emacs-test-functions.sh b/test/emacs-test-functions.sh\r
72 new file mode 100755\r
73 index 0000000..969cc78\r
74 --- /dev/null\r
75 +++ b/test/emacs-test-functions.sh\r
76 @@ -0,0 +1,8 @@\r
77 +#!/usr/bin/env bash\r
78 +\r
79 +test_description="emacs test function sanity"\r
80 +. test-lib.sh\r
81 +\r
82 +test_emacs_expect_t "emacs test function sanity" 't'\r
83 +\r
84 +test_done\r
85 diff --git a/test/notmuch-test b/test/notmuch-test\r
86 index 6a99ae3..d034f99 100755\r
87 --- a/test/notmuch-test\r
88 +++ b/test/notmuch-test\r
89 @@ -52,6 +52,7 @@ TESTS="\r
90    python\r
91    hooks\r
92    argument-parsing\r
93 +  emacs-test-functions.sh\r
94  "\r
95  TESTS=${NOTMUCH_TESTS:=$TESTS}\r
96  \r
97 diff --git a/test/test-lib.sh b/test/test-lib.sh\r
98 index 7c9ce24..15da973 100644\r
99 --- a/test/test-lib.sh\r
100 +++ b/test/test-lib.sh\r
101 @@ -503,6 +503,30 @@ test_expect_equal_file ()\r
102      fi\r
103  }\r
104  \r
105 +test_emacs_expect_t () {\r
106 +       test "$#" = 2 || error "bug in the test script: not 2 parameters to test_emacs_expect_t"\r
107 +       test_reset_state_\r
108 +       if ! test_skip "$1"\r
109 +       then\r
110 +               # We cannot call 'test_emacs' in a subshell, because\r
111 +               # the setting of EMACS_SERVER would not persist\r
112 +               # throughout a sequence of tests, so we use a\r
113 +               # temporary file.\r
114 +               tmp="$TMPDIR"; if [ -z "$tmp" ]; then tmp=/tmp; fi\r
115 +               output="$tmp/test_emacs_output.$$"\r
116 +               test_emacs "$2" >"${output}"\r
117 +               result=$(cat "${output}")\r
118 +               rm -f "${output}"\r
119 +\r
120 +               if [ "$result" == t ]\r
121 +               then\r
122 +                       test_ok_ "$1"\r
123 +               else\r
124 +                       test_failure_ "$1" "$(eval printf ${result})"\r
125 +               fi\r
126 +       fi\r
127 +}\r
128 +\r
129  NOTMUCH_NEW ()\r
130  {\r
131      notmuch new | grep -v -E -e '^Processed [0-9]*( total)? file|Found [0-9]* total file'\r
132 -- \r
133 1.7.7.3\r
134 \r