Re: Hi all
[notmuch-archives.git] / 5b / fd62c781b8679e46751c4e421ac7a890fee14a
1 Return-Path: <schnouki@schnouki.net>\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 172BC429E25\r
6         for <notmuch@notmuchmail.org>; Wed, 20 Jul 2011 05:37:07 -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.1\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1]\r
13         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 4DeG6dXLStIV for <notmuch@notmuchmail.org>;\r
17         Wed, 20 Jul 2011 05:37:04 -0700 (PDT)\r
18 Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222])\r
19         by olra.theworths.org (Postfix) with ESMTP id 9F660431FB6\r
20         for <notmuch@notmuchmail.org>; Wed, 20 Jul 2011 05:37:04 -0700 (PDT)\r
21 Received: from localhost.localdomain (thor.loria.fr [152.81.12.250])\r
22         by ks3536.kimsufi.com (Postfix) with ESMTPSA id 112176A06A9;\r
23         Wed, 20 Jul 2011 14:45:47 +0200 (CEST)\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net;\r
25         s=key-schnouki; t=1311165947;\r
26         bh=0V9P7IWWHsOXYhqc67HTWleu1qifIw+ymnNVX84qBBk=;\r
27         h=From:To:Subject:Date:Message-Id:In-Reply-To:References;\r
28         b=dwK23YXhe0jlznFVyhqvSmF4WmJatkDnaBBAx8OCChLPCA9G4huJiLEI4U1SD/JXo\r
29         YIIp30z/zNEzDVojTiJhLvzdl2ViQQD+QXSvcln6Z3hU84geklX2bGCTzXcYKSgmyk\r
30         aP7KF5bMqfdVzCrCViNhcdz5rB/dgumXTdnTjvAo=\r
31 From: Thomas Jost <schnouki@schnouki.net>\r
32 To: notmuch@notmuchmail.org,\r
33         Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
34 Subject: [PATCH] test: run emacs inside tmux if screen is not available\r
35 Date: Wed, 20 Jul 2011 14:36:36 +0200\r
36 Message-Id: <1311165396-12268-1-git-send-email-schnouki@schnouki.net>\r
37 X-Mailer: git-send-email 1.7.6\r
38 In-Reply-To: <1309496122-4965-2-git-send-email-dmitry.kurochkin@gmail.com>\r
39 References: <1309496122-4965-2-git-send-email-dmitry.kurochkin@gmail.com>\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Wed, 20 Jul 2011 12:37:07 -0000\r
53 \r
54 Before this change, the test suite reported many failed tests on machines where\r
55 screen is not installed (which is the case of many *BSD systems). This patch\r
56 makes the test suite try to use tmux, another terminal multiplexer, if screen is\r
57 not available.\r
58 ---\r
59  test/test-lib.sh |   13 +++++++++++--\r
60  1 files changed, 11 insertions(+), 2 deletions(-)\r
61 \r
62 diff --git a/test/test-lib.sh b/test/test-lib.sh\r
63 index 0608e42..5851b3d 100755\r
64 --- a/test/test-lib.sh\r
65 +++ b/test/test-lib.sh\r
66 @@ -860,12 +860,21 @@ EOF\r
67  test_emacs () {\r
68         if [ -z "$EMACS_SERVER" ]; then\r
69                 EMACS_SERVER="notmuch-test-suite-$$"\r
70 -               # start a detached screen session with an emacs server\r
71 +               # start a detached screen or tmux session with an emacs server\r
72                 screen -S "$EMACS_SERVER" -d -m "$TMP_DIRECTORY/run_emacs" \\r
73                         --no-window-system \\r
74                         --eval "(setq server-name \"$EMACS_SERVER\")" \\r
75                         --eval '(server-start)' \\r
76 -                       --eval "(orphan-watchdog $$)" || return\r
77 +                       --eval "(orphan-watchdog $$)"\r
78 +               if [ "$?" != 0 ]\r
79 +               then\r
80 +                       tmux -f /dev/null -L "$EMACS_SERVER" new-session -d "$TMP_DIRECTORY/run_emacs \\r
81 +                               --no-window-system \\r
82 +                               --eval \"(setq server-name \\\"$EMACS_SERVER\\\")\" \\r
83 +                               --eval '(server-start)' \\r
84 +                               --eval \"(orphan-watchdog $$)\"" || return\r
85 +               fi\r
86 +\r
87                 # wait until the emacs server is up\r
88                 until test_emacs '()' 2>/dev/null; do\r
89                         sleep 1\r
90 -- \r
91 1.7.6\r
92 \r