[PATCH 6/9] CLI: refactor dumping of tags.
[notmuch-archives.git] / b5 / 0c4862197c4772a867c0a3ce66b59835e4b86a
1 Return-Path: <dmitry.kurochkin@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 D1F9D429E26\r
6         for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 09:35:23 -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.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 i5-rak7gLWjg for <notmuch@notmuchmail.org>;\r
17         Thu, 12 Jan 2012 09:35:23 -0800 (PST)\r
18 Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
19         [209.85.214.53]) (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 2E6E7429E27\r
22         for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 09:35:23 -0800 (PST)\r
23 Received: by bkat2 with SMTP id t2so1653030bka.26\r
24         for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 09:35:20 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
27         :message-id:mime-version:content-type;\r
28         bh=nq5aZU7RceQd+fQn81ygi/xlY3zHpxz18O9DNt58Pyk=;\r
29         b=PwBOq5eOVADHy7iFI/psderPhxaGy9TB+O1ftxRK0rwAO4Fx1F5xO33vZsHrfpecQh\r
30         D6r6vN/iJGLV5spGuLMJuAwsJR8H7BX7BfehGptYQeGHwrZeMHtUE/w8iihz77qH1DQQ\r
31         NGOUHroe8wxQ+3dWc/qX//wHnuKNBWHpp/NT0=\r
32 Received: by 10.204.148.88 with SMTP id o24mr1602514bkv.39.1326389720522;\r
33         Thu, 12 Jan 2012 09:35:20 -0800 (PST)\r
34 Received: from localhost ([91.144.186.21])\r
35         by mx.google.com with ESMTPS id a17sm12109088bkz.7.2012.01.12.09.35.19\r
36         (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Thu, 12 Jan 2012 09:35:20 -0800 (PST)\r
38 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
39 To: Pieter Praet <pieter@praet.org>\r
40 Subject: Re: [PATCH] test: don't bail out of `run_emacs' too early when\r
41         missing prereqs\r
42 In-Reply-To: <1326388619-17422-1-git-send-email-pieter@praet.org>\r
43 References: <87d3aolu61.fsf@praet.org>\r
44         <1326388619-17422-1-git-send-email-pieter@praet.org>\r
45 User-Agent: Notmuch/0.10.2+135~gb811a3c (http://notmuchmail.org) Emacs/23.3.1\r
46         (x86_64-pc-linux-gnu)\r
47 Date: Thu, 12 Jan 2012 21:34:29 +0400\r
48 Message-ID: <87zkdsg6ze.fsf@gmail.com>\r
49 MIME-Version: 1.0\r
50 Content-Type: text/plain; charset=us-ascii\r
51 Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
52 X-BeenThere: notmuch@notmuchmail.org\r
53 X-Mailman-Version: 2.1.13\r
54 Precedence: list\r
55 List-Id: "Use and development of the notmuch mail system."\r
56         <notmuch.notmuchmail.org>\r
57 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
59 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
60 List-Post: <mailto:notmuch@notmuchmail.org>\r
61 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
62 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
64 X-List-Received-Date: Thu, 12 Jan 2012 17:35:24 -0000\r
65 \r
66 On Thu, 12 Jan 2012 18:16:59 +0100, Pieter Praet <pieter@praet.org> wrote:\r
67 > When running the Emacs tests in verbose mode, only the first missing\r
68 > prereq is reported because the `run_emacs' function is short-circuited\r
69 > early:\r
70\r
71 >   #+begin_example\r
72 >     emacs: Testing emacs interface\r
73 >      missing prerequisites: [0]  emacs(1)\r
74 >      skipping test: [0]  Basic notmuch-hello view in emacs\r
75 >      SKIP   [0]  Basic notmuch-hello view in emacs\r
76 >   #+end_example\r
77\r
78 > This can lead to situations reminiscent of "dependency hell", so instead\r
79 > of returning based on each individual `test_require_external_prereq's exit\r
80 > status, we now do so by checking $test_subtest_missing_external_prereqs_:\r
81\r
82 >   #+begin_example\r
83 >     emacs: Testing emacs interface\r
84 >      missing prerequisites: [0]  dtach(1) emacs(1) emacsclient(1)\r
85 >      skipping test: [0]  Basic notmuch-hello view in emacs\r
86 >      SKIP   [0]  Basic notmuch-hello view in emacs\r
87 >   #+end_example\r
88\r
89 > Also add missing prereq for dtach(1).\r
90\r
91 > ---\r
92 >  test/test-lib.sh |    6 ++++--\r
93 >  1 files changed, 4 insertions(+), 2 deletions(-)\r
94\r
95 > diff --git a/test/test-lib.sh b/test/test-lib.sh\r
96 > index 82767c0..6ec3882 100644\r
97 > --- a/test/test-lib.sh\r
98 > +++ b/test/test-lib.sh\r
99 > @@ -907,8 +907,10 @@ EOF\r
100 >  \r
101 >  test_emacs () {\r
102 >       # test dependencies beforehand to avoid the waiting loop below\r
103 > -     test_require_external_prereq emacs || return\r
104 > -     test_require_external_prereq emacsclient || return\r
105 > +     test_require_external_prereq dtach\r
106 > +     test_require_external_prereq emacs\r
107 > +     test_require_external_prereq emacsclient\r
108 > +     test -z "$test_subtest_missing_external_prereqs_" || return\r
109 \r
110 There may be other missing dependencies before test_emacs() is called\r
111 and $test_subtest_missing_external_prereqs_ would not be blank.  Also, I\r
112 would like to keep the number of functions that use\r
113 $test_subtest_missing_external_prereqs_ minimal.  How about:\r
114 \r
115   missing_dependencies=\r
116   test_require_... dtach || missing_dependencies=1\r
117   test_require_... emacs || missing_dependencies=1\r
118   ...\r
119   test -z "$missing_dependencies" || return\r
120 \r
121 Regards,\r
122   Dmitry\r
123 \r
124 >  \r
125 >       if [ -z "$EMACS_SERVER" ]; then\r
126 >               server_name="notmuch-test-suite-$$"\r
127 > -- \r
128 > 1.7.8.1\r
129\r