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
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
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
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
64 Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
\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
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
75 +++ b/test/T540-ruby.sh
\r
77 +#!/usr/bin/env bash
\r
79 +# Copyright (c) 2014 Felipe Contreras
\r
82 +test_description="Ruby bindings"
\r
86 +export LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib
\r
87 +export RUBYLIB=$TEST_DIRECTORY/../bindings/ruby
\r
89 +if ! test_have_prereq RUBY
\r
91 + skip_all='skipping ruby tests'
\r
96 + cat > test.rb <<-\EOF &&
\r
97 + #!/usr/bin/env ruby
\r
101 + $MAIL_DIR = ENV['MAIL_DIR']
\r
103 + cat >> test.rb &&
\r
107 +test_expect_success 'setup' '
\r
108 + add_email_corpus &&
\r
109 + notmuch new --quiet &&
\r
113 +test_expect_success 'new and close' '
\r
114 + test_ruby <<-\EOF
\r
115 + db = Notmuch::Database.new($MAIL_DIR)
\r
120 +test_expect_success 'open' '
\r
121 + test_ruby <<-\EOF
\r
122 + Notmuch::Database.open($MAIL_DIR) do |db|
\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
134 + test_cmp expected actual
\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
145 + test_cmp expected actual
\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
158 + test_cmp expected actual
\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
171 + test_cmp expected actual
\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
181 emacs_generate_script
\r
183 +grep -q "WITH_RUBY = 1" ../Makefile.config && test_set_prereq RUBY
\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
188 1.9.3+fc1~5~gfaddd51
\r