Re: notmuch-emacs should correctly handle signature status on reply
[notmuch-archives.git] / d6 / 2af0656511fe224804765882bceac3a34981df
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 arlo.cworth.org (Postfix) with ESMTP id 84DBD6DE1833\r
6  for <notmuch@notmuchmail.org>; Mon,  1 Jun 2015 00:11:09 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.262\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.262 tagged_above=-999 required=5 tests=[AWL=0.252, \r
12  T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id WTe3AE9n7A-v for <notmuch@notmuchmail.org>;\r
16  Mon,  1 Jun 2015 00:11:07 -0700 (PDT)\r
17 Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net\r
18  [87.98.215.224])\r
19  by arlo.cworth.org (Postfix) with ESMTPS id B84D46DE1640\r
20  for <notmuch@notmuchmail.org>; Mon,  1 Jun 2015 00:11:07 -0700 (PDT)\r
21 Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim\r
22  4.80) (envelope-from <bremner@tesseract.cs.unb.ca>)\r
23  id 1YzJre-0007OQ-6u; Mon, 01 Jun 2015 07:10:26 +0000\r
24 Received: (nullmailer pid 2455 invoked by uid 1000); Mon, 01 Jun 2015\r
25  07:09:06 -0000\r
26 From: David Bremner <david@tethera.net>\r
27 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
28 Subject: [patch v3 4/4] test: add initial ruby tests\r
29 Date: Mon,  1 Jun 2015 09:09:02 +0200\r
30 Message-Id: <1433142542-2307-5-git-send-email-david@tethera.net>\r
31 X-Mailer: git-send-email 2.1.4\r
32 In-Reply-To: <1433142542-2307-1-git-send-email-david@tethera.net>\r
33 References: <1425679073-30439-5-git-send-email-david@tethera.net>\r
34  <1433142542-2307-1-git-send-email-david@tethera.net>\r
35 X-BeenThere: notmuch@notmuchmail.org\r
36 X-Mailman-Version: 2.1.18\r
37 Precedence: list\r
38 List-Id: "Use and development of the notmuch mail system."\r
39  <notmuch.notmuchmail.org>\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
41  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
43 List-Post: <mailto:notmuch@notmuchmail.org>\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
46  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
47 X-List-Received-Date: Mon, 01 Jun 2015 07:11:09 -0000\r
48 \r
49 This is pretty much a line by line translation of the existing python\r
50 tests, with two new tests for the count API.\r
51 ---\r
52  test/T395-ruby.sh | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
53  test/test-lib.sh  |  5 ++++\r
54  2 files changed, 91 insertions(+)\r
55  create mode 100755 test/T395-ruby.sh\r
56 \r
57 diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh\r
58 new file mode 100755\r
59 index 0000000..8b8e6d2\r
60 --- /dev/null\r
61 +++ b/test/T395-ruby.sh\r
62 @@ -0,0 +1,86 @@\r
63 +#!/usr/bin/env bash\r
64 +test_description="ruby bindings"\r
65 +. ./test-lib.sh\r
66 +\r
67 +if [ "${NOTMUCH_HAVE_RUBY_DEV}" = "0" ]; then\r
68 +    test_subtest_missing_external_prereq_["ruby development files"]=t\r
69 +fi\r
70 +\r
71 +add_email_corpus\r
72 +\r
73 +test_begin_subtest "compare thread ids"\r
74 +test_ruby <<"EOF"\r
75 +require 'notmuch'\r
76 +$maildir = ENV['MAIL_DIR']\r
77 +if not $maildir then\r
78 +  abort('environment variable MAIL_DIR must be set')\r
79 +end\r
80 +@db = Notmuch::Database.new($maildir)\r
81 +@q = @db.query('tag:inbox')\r
82 +@q.sort = Notmuch::SORT_OLDEST_FIRST\r
83 +for t in @q.search_threads do\r
84 +  print t.thread_id, "\n"\r
85 +end\r
86 +EOF\r
87 +notmuch search --sort=oldest-first --output=threads tag:inbox | sed s/^thread:// > EXPECTED\r
88 +test_expect_equal_file OUTPUT EXPECTED\r
89 +\r
90 +test_begin_subtest "compare message ids"\r
91 +test_ruby <<"EOF"\r
92 +require 'notmuch'\r
93 +$maildir = ENV['MAIL_DIR']\r
94 +if not $maildir then\r
95 +  abort('environment variable MAIL_DIR must be set')\r
96 +end\r
97 +@db = Notmuch::Database.new($maildir)\r
98 +@q = @db.query('tag:inbox')\r
99 +@q.sort = Notmuch::SORT_OLDEST_FIRST\r
100 +for m in @q.search_messages do\r
101 +  print m.message_id, "\n"\r
102 +end\r
103 +EOF\r
104 +notmuch search --sort=oldest-first --output=messages tag:inbox | sed s/^id:// > EXPECTED\r
105 +test_expect_equal_file OUTPUT EXPECTED\r
106 +\r
107 +test_begin_subtest "get non-existent file"\r
108 +test_ruby <<"EOF"\r
109 +require 'notmuch'\r
110 +$maildir = ENV['MAIL_DIR']\r
111 +if not $maildir then\r
112 +  abort('environment variable MAIL_DIR must be set')\r
113 +end\r
114 +@db = Notmuch::Database.new($maildir)\r
115 +result = @db.find_message_by_filename('i-dont-exist')\r
116 +print (result == nil)\r
117 +EOF\r
118 +test_expect_equal "$(cat OUTPUT)" "true"\r
119 +\r
120 +test_begin_subtest "count messages"\r
121 +test_ruby <<"EOF"\r
122 +require 'notmuch'\r
123 +$maildir = ENV['MAIL_DIR']\r
124 +if not $maildir then\r
125 +  abort('environment variable MAIL_DIR must be set')\r
126 +end\r
127 +@db = Notmuch::Database.new($maildir)\r
128 +@q = @db.query('tag:inbox')\r
129 +print @q.count_messages(),"\n"\r
130 +EOF\r
131 +notmuch count --output=messages tag:inbox > EXPECTED\r
132 +test_expect_equal_file OUTPUT EXPECTED\r
133 +\r
134 +test_begin_subtest "count threads"\r
135 +test_ruby <<"EOF"\r
136 +require 'notmuch'\r
137 +$maildir = ENV['MAIL_DIR']\r
138 +if not $maildir then\r
139 +  abort('environment variable MAIL_DIR must be set')\r
140 +end\r
141 +@db = Notmuch::Database.new($maildir)\r
142 +@q = @db.query('tag:inbox')\r
143 +print @q.count_threads(),"\n"\r
144 +EOF\r
145 +notmuch count --output=threads tag:inbox > EXPECTED\r
146 +test_expect_equal_file OUTPUT EXPECTED\r
147 +\r
148 +test_done\r
149 diff --git a/test/test-lib.sh b/test/test-lib.sh\r
150 index 23085e7..3466e9c 100644\r
151 --- a/test/test-lib.sh\r
152 +++ b/test/test-lib.sh\r
153 @@ -1163,6 +1163,11 @@ test_python() {\r
154                 | $cmd -\r
155  }\r
156  \r
157 +test_ruby() {\r
158 +    export LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib\r
159 +    MAIL_DIR=$MAIL_DIR ruby -I $TEST_DIRECTORY/../bindings/ruby> OUTPUT\r
160 +}\r
161 +\r
162  test_C () {\r
163      exec_file="test${test_count}"\r
164      test_file="${exec_file}.c"\r
165 -- \r
166 2.1.4\r
167 \r