Re: [PATCH 1/9] reorganize indexing of multipart/signed and multipart/encrypted
[notmuch-archives.git] / d2 / 08d27344935ba39f8f05c97d5a547e91266e5f
1 Return-Path: <felipe.contreras@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 2010B431FC4\r
6         for <notmuch@notmuchmail.org>; Fri, 23 May 2014 03:45:56 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id V95y3NXdnrQl for <notmuch@notmuchmail.org>;\r
17         Fri, 23 May 2014 03:45:52 -0700 (PDT)\r
18 Received: from mail-oa0-f52.google.com (mail-oa0-f52.google.com\r
19         [209.85.219.52]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 812C7431FBF\r
22         for <notmuch@notmuchmail.org>; Fri, 23 May 2014 03:45:52 -0700 (PDT)\r
23 Received: by mail-oa0-f52.google.com with SMTP id eb12so5306111oac.25\r
24         for <notmuch@notmuchmail.org>; Fri, 23 May 2014 03:45:52 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26         h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
27         bh=+rT3WnT606MhtF+BlvHH+wn44Xrd6X2aR32HVTAtBn0=;\r
28         b=mud0HMO83vzt/UUZQgieWEE7HFxn9uhS78c8xfLtFpI0y5KQa56j+bZ7p1HYseCtBz\r
29         Lw3gMlOuDdwH/obkfa/p2j+OVkDLLvG8t8lcULED5WyHt6tP+WUFPykJosNGWQtTv1PJ\r
30         G2rGKuZr3fO+MXW1+gtmKeae88YPIBswGvpC79rfCUGmTECZUrxJtCSfvP77MjGksA51\r
31         xo3DXKL183tgtP7DSGb4S4Wk6YyoafcKUc9YXVwDCYPBhbz/SPtf5B9jctodSZX3vV7Z\r
32         tiC14cbHeDtJOFx1KEljLC3vir/YfES8zKBWMZlvgTnJmMKDVyLHY6F44x6cKA6u2FIz\r
33         Z4vg==\r
34 X-Received: by 10.60.55.97 with SMTP id r1mr3811442oep.5.1400841952145;\r
35         Fri, 23 May 2014 03:45:52 -0700 (PDT)\r
36 Received: from localhost (189-211-224-40.static.axtel.net. [189.211.224.40])\r
37         by mx.google.com with ESMTPSA id ld8sm4881937obb.9.2014.05.23.03.45.50\r
38         for <multiple recipients>\r
39         (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
40         Fri, 23 May 2014 03:45:51 -0700 (PDT)\r
41 From: Felipe Contreras <felipe.contreras@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH 3/3] test: add tests for Ruby bindings\r
44 Date: Fri, 23 May 2014 05:34:27 -0500\r
45 Message-Id: <1400841267-12807-4-git-send-email-felipe.contreras@gmail.com>\r
46 X-Mailer: git-send-email 1.9.3+fc1~5~gfaddd51\r
47 In-Reply-To: <1400841267-12807-1-git-send-email-felipe.contreras@gmail.com>\r
48 References: <1400841267-12807-1-git-send-email-felipe.contreras@gmail.com>\r
49 Cc: Ali Polatel <alip@exherbo.org>\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\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: Fri, 23 May 2014 10:45:56 -0000\r
63 \r
64 Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\r
65 ---\r
66  test/T540-ruby.sh | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
67  test/test-lib.sh  |  1 +\r
68  2 files changed, 99 insertions(+)\r
69  create mode 100755 test/T540-ruby.sh\r
70 \r
71 diff --git a/test/T540-ruby.sh b/test/T540-ruby.sh\r
72 new file mode 100755\r
73 index 0000000..a9f6ac5\r
74 --- /dev/null\r
75 +++ b/test/T540-ruby.sh\r
76 @@ -0,0 +1,98 @@\r
77 +#!/usr/bin/env bash\r
78 +#\r
79 +# Copyright (c) 2014 Felipe Contreras\r
80 +#\r
81 +\r
82 +test_description="Ruby bindings"\r
83 +\r
84 +. ./test-lib.sh\r
85 +\r
86 +export LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib\r
87 +export RUBYLIB=$TEST_DIRECTORY/../bindings/ruby\r
88 +\r
89 +if ! test_have_prereq RUBY\r
90 +then\r
91 +       skip_all='skipping ruby tests'\r
92 +       test_done\r
93 +fi\r
94 +\r
95 +test_ruby () {\r
96 +       cat > test.rb <<-\EOF &&\r
97 +       #!/usr/bin/env ruby\r
98 +\r
99 +       require 'notmuch'\r
100 +\r
101 +       $MAIL_DIR = ENV['MAIL_DIR']\r
102 +       EOF\r
103 +       cat >> test.rb &&\r
104 +       ruby test.rb\r
105 +}\r
106 +\r
107 +test_expect_success 'setup' '\r
108 +       add_email_corpus &&\r
109 +       notmuch new --quiet &&\r
110 +       export MAIL_DIR\r
111 +'\r
112 +\r
113 +test_expect_success 'new and close' '\r
114 +       test_ruby <<-\EOF\r
115 +       db = Notmuch::Database.new($MAIL_DIR)\r
116 +       db.close\r
117 +       EOF\r
118 +'\r
119 +\r
120 +test_expect_success 'open' '\r
121 +       test_ruby <<-\EOF\r
122 +       Notmuch::Database.open($MAIL_DIR) do |db|\r
123 +       end\r
124 +       EOF\r
125 +'\r
126 +\r
127 +test_expect_success 'path' '\r
128 +       echo $MAIL_DIR > expected &&\r
129 +       test_ruby > actual <<-\EOF &&\r
130 +       Notmuch::Database.open($MAIL_DIR) do |db|\r
131 +               puts db.path\r
132 +       end\r
133 +       EOF\r
134 +       test_cmp expected actual\r
135 +'\r
136 +\r
137 +test_expect_success 'query' '\r
138 +       notmuch count "tag:inbox" > expected &&\r
139 +       test_ruby > actual <<-\EOF &&\r
140 +       Notmuch::Database.open($MAIL_DIR) do |db|\r
141 +               query = db.query("tag:inbox")\r
142 +               puts query.count_messages\r
143 +       end\r
144 +       EOF\r
145 +       test_cmp expected actual\r
146 +'\r
147 +\r
148 +test_expect_success 'query threads' '\r
149 +       notmuch search --output=threads "tag:inbox" > expected &&\r
150 +       test_ruby > actual <<-\EOF &&\r
151 +       Notmuch::Database.open($MAIL_DIR) do |db|\r
152 +               query = db.query("tag:inbox")\r
153 +               query.search_threads.each do |thread|\r
154 +                       puts "thread:" + thread.thread_id\r
155 +               end\r
156 +       end\r
157 +       EOF\r
158 +       test_cmp expected actual\r
159 +'\r
160 +\r
161 +test_expect_success 'query messages' '\r
162 +       notmuch search --output=messages "tag:inbox" > expected &&\r
163 +       test_ruby > actual <<-\EOF &&\r
164 +       Notmuch::Database.open($MAIL_DIR) do |db|\r
165 +               query = db.query("tag:inbox")\r
166 +               query.search_messages.each do |message|\r
167 +                       puts "id:" + message.message_id\r
168 +               end\r
169 +       end\r
170 +       EOF\r
171 +       test_cmp expected actual\r
172 +'\r
173 +\r
174 +test_done\r
175 diff --git a/test/test-lib.sh b/test/test-lib.sh\r
176 index 8697d6a..1f9dd1f 100644\r
177 --- a/test/test-lib.sh\r
178 +++ b/test/test-lib.sh\r
179 @@ -1208,6 +1208,7 @@ test_init_ () {\r
180  \r
181  emacs_generate_script\r
182  \r
183 +grep -q "WITH_RUBY = 1" ../Makefile.config && test_set_prereq RUBY\r
184  \r
185  # Use -P to resolve symlinks in our working directory so that the cwd\r
186  # in subprocesses like git equals our $PWD (for pathname comparisons).\r
187 -- \r
188 1.9.3+fc1~5~gfaddd51\r
189 \r