[PATCH 10/16] test: add test for notmuch tag --batch option
[notmuch-archives.git] / 76 / 2f694571b42819aef7e26c9b435a1c28900670
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 A688B421192\r
6         for <notmuch@notmuchmail.org>; Thu, 30 Jun 2011 21:55:34 -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 eAZ7DnRrZJeD for <notmuch@notmuchmail.org>;\r
17         Thu, 30 Jun 2011 21:55:34 -0700 (PDT)\r
18 Received: from mail-bw0-f53.google.com (mail-bw0-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 02AF642118E\r
22         for <notmuch@notmuchmail.org>; Thu, 30 Jun 2011 21:55:33 -0700 (PDT)\r
23 Received: by mail-bw0-f53.google.com with SMTP id 12so2682445bwg.26\r
24         for <notmuch@notmuchmail.org>; Thu, 30 Jun 2011 21:55:33 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
27         bh=4YPNwS2Xs30PUOBA3RY8YnfRE1Tb5gszO9XJGQBO2LE=;\r
28         b=xMgLKtfbTfLVW9h70j4/kSvvRTd0UeRSwqHk7e+RdsUbJNhHbC8D40jLt8sXUIMUST\r
29         GU4lKKgv3ocur+/9uDsA5hUD+gYHtbId47gBcAjqvBlDfIrMaX9+eGzE5SuQPy4qyzvk\r
30         3OYxj0neJyU25E09gcdzkaZeejzY24m1AXiyw=\r
31 Received: by 10.204.138.142 with SMTP id a14mr2568160bku.195.1309496133628;\r
32         Thu, 30 Jun 2011 21:55:33 -0700 (PDT)\r
33 Received: from localhost ([91.144.186.21])\r
34         by mx.google.com with ESMTPS id e16sm2003358bke.18.2011.06.30.21.55.31\r
35         (version=TLSv1/SSLv3 cipher=OTHER);\r
36         Thu, 30 Jun 2011 21:55:32 -0700 (PDT)\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH v2 1/7] test: run emacs inside screen\r
40 Date: Fri,  1 Jul 2011 08:55:16 +0400\r
41 Message-Id: <1309496122-4965-2-git-send-email-dmitry.kurochkin@gmail.com>\r
42 X-Mailer: git-send-email 1.7.5.4\r
43 In-Reply-To: <1309496122-4965-1-git-send-email-dmitry.kurochkin@gmail.com>\r
44 References: <1309376558-26284-1-git-send-email-dmitry.kurochkin@gmail.com>\r
45         <1309496122-4965-1-git-send-email-dmitry.kurochkin@gmail.com>\r
46 X-BeenThere: notmuch@notmuchmail.org\r
47 X-Mailman-Version: 2.1.13\r
48 Precedence: list\r
49 List-Id: "Use and development of the notmuch mail system."\r
50         <notmuch.notmuchmail.org>\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
54 List-Post: <mailto:notmuch@notmuchmail.org>\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
58 X-List-Received-Date: Fri, 01 Jul 2011 04:55:34 -0000\r
59 \r
60 Before the change, emacs run in daemon mode without any visible\r
61 buffers.  Turns out that this affects emacs behavior in some\r
62 cases.  In particular, `window-end' function returns `point-max'\r
63 instead of the last visible position.  That makes it hard or\r
64 impossible to implement some tests.  The patch runs emacs in a\r
65 detached screen(1) session.  So that it works exactly as if it\r
66 has a visible window.\r
67 \r
68 Note: screen terminates when emacs exits.  So the patch does not\r
69 introduce new "running processes left behind" issues.\r
70 ---\r
71  test/test-lib.sh |   10 ++++++++--\r
72  1 files changed, 8 insertions(+), 2 deletions(-)\r
73 \r
74 diff --git a/test/test-lib.sh b/test/test-lib.sh\r
75 index 22e387e..688598c 100755\r
76 --- a/test/test-lib.sh\r
77 +++ b/test/test-lib.sh\r
78 @@ -858,10 +858,16 @@ EOF\r
79  test_emacs () {\r
80         if [ -z "$EMACS_SERVER" ]; then\r
81                 EMACS_SERVER="notmuch-test-suite-$$"\r
82 -               "$TMP_DIRECTORY/run_emacs" \\r
83 -                       --daemon \\r
84 +               # start a detached screen session with an emacs server\r
85 +               screen -S "$EMACS_SERVER" -d -m "$TMP_DIRECTORY/run_emacs" \\r
86 +                       --no-window-system \\r
87                         --eval "(setq server-name \"$EMACS_SERVER\")" \\r
88 +                       --eval '(server-start)' \\r
89                         --eval "(orphan-watchdog $$)" || return\r
90 +               # wait until the emacs server is up\r
91 +               until test_emacs '()' 2>/dev/null; do\r
92 +                       sleep 1\r
93 +               done\r
94         fi\r
95  \r
96         emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)"\r
97 -- \r
98 1.7.5.4\r
99 \r