Re: [PATCH] test: run emacs inside tmux if screen is not available
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Wed, 20 Jul 2011 13:37:35 +0000 (17:37 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:10 +0000 (09:39 -0800)
ad/8de51510f96ba71ce55074539188abfb44651e [new file with mode: 0644]

diff --git a/ad/8de51510f96ba71ce55074539188abfb44651e b/ad/8de51510f96ba71ce55074539188abfb44651e
new file mode 100644 (file)
index 0000000..3b72b92
--- /dev/null
@@ -0,0 +1,117 @@
+Return-Path: <dmitry.kurochkin@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 18A35429E21\r
+       for <notmuch@notmuchmail.org>; Wed, 20 Jul 2011 06:37:45 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id nqyHMDMZU6mR for <notmuch@notmuchmail.org>;\r
+       Wed, 20 Jul 2011 06:37:42 -0700 (PDT)\r
+Received: from mail-ew0-f53.google.com (mail-ew0-f53.google.com\r
+       [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 76AEF431FB6\r
+       for <notmuch@notmuchmail.org>; Wed, 20 Jul 2011 06:37:42 -0700 (PDT)\r
+Received: by ewy8 with SMTP id 8so614462ewy.26\r
+       for <notmuch@notmuchmail.org>; Wed, 20 Jul 2011 06:37:41 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+       :mime-version:content-type;\r
+       bh=MFwI0sifZiBXIp6MtaKmOgIdlqX8JXhxLGWA5NGWIvE=;\r
+       b=kcM1YDoFYqERdcdk81k7ReA8KBIB4OpjqH90VX/5Nw/T3Mt5pT5RAOfS+/hDrYR0aj\r
+       rSNwUKuQf6CIxnETYTMs10/PvwLVu5MmPmTXyoVsAiOZMS2ImTYxmb5fcf/mpnyg6hZx\r
+       vf/rbxCquz73SEY6nTdV544V4KoOJQffL/S4A=\r
+Received: by 10.213.9.201 with SMTP id m9mr637988ebm.64.1311169060958;\r
+       Wed, 20 Jul 2011 06:37:40 -0700 (PDT)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id n42sm554697eef.36.2011.07.20.06.37.39\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Wed, 20 Jul 2011 06:37:40 -0700 (PDT)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: Thomas Jost <schnouki@schnouki.net>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] test: run emacs inside tmux if screen is not available\r
+In-Reply-To: <1311165396-12268-1-git-send-email-schnouki@schnouki.net>\r
+References: <1309496122-4965-2-git-send-email-dmitry.kurochkin@gmail.com>\r
+       <1311165396-12268-1-git-send-email-schnouki@schnouki.net>\r
+User-Agent: Notmuch/0.5-321-g41686e2 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Wed, 20 Jul 2011 17:37:35 +0400\r
+Message-ID: <87d3h5ul7k.fsf@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 20 Jul 2011 13:37:45 -0000\r
+\r
+Hi Thomas.\r
+\r
+On Wed, 20 Jul 2011 14:36:36 +0200, Thomas Jost <schnouki@schnouki.net> wrote:\r
+> Before this change, the test suite reported many failed tests on machines where\r
+> screen is not installed (which is the case of many *BSD systems). This patch\r
+> makes the test suite try to use tmux, another terminal multiplexer, if screen is\r
+> not available.\r
+\r
+This is a nice improvement.  But I think we should make it even better :)\r
+There are more terminal emulators besides screen and tmux (dtach comes\r
+to mind).  We need a more general mechanism for trying them.  There\r
+should be a list of commands for running terminal emulators in the order\r
+of preference (I think that is dtach, tmux, screen), and we should try\r
+each one in a loop (this would also avoid repeating the long emacs\r
+command).\r
+\r
+Regards,\r
+  Dmitry\r
+\r
+> ---\r
+>  test/test-lib.sh |   13 +++++++++++--\r
+>  1 files changed, 11 insertions(+), 2 deletions(-)\r
+> \r
+> diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+> index 0608e42..5851b3d 100755\r
+> --- a/test/test-lib.sh\r
+> +++ b/test/test-lib.sh\r
+> @@ -860,12 +860,21 @@ EOF\r
+>  test_emacs () {\r
+>      if [ -z "$EMACS_SERVER" ]; then\r
+>              EMACS_SERVER="notmuch-test-suite-$$"\r
+> -            # start a detached screen session with an emacs server\r
+> +            # start a detached screen or tmux session with an emacs server\r
+>              screen -S "$EMACS_SERVER" -d -m "$TMP_DIRECTORY/run_emacs" \\r
+>                      --no-window-system \\r
+>                      --eval "(setq server-name \"$EMACS_SERVER\")" \\r
+>                      --eval '(server-start)' \\r
+> -                    --eval "(orphan-watchdog $$)" || return\r
+> +                    --eval "(orphan-watchdog $$)"\r
+> +            if [ "$?" != 0 ]\r
+> +            then\r
+> +                    tmux -f /dev/null -L "$EMACS_SERVER" new-session -d "$TMP_DIRECTORY/run_emacs \\r
+> +                            --no-window-system \\r
+> +                            --eval \"(setq server-name \\\"$EMACS_SERVER\\\")\" \\r
+> +                            --eval '(server-start)' \\r
+> +                            --eval \"(orphan-watchdog $$)\"" || return\r
+> +            fi\r
+> +\r
+>              # wait until the emacs server is up\r
+>              until test_emacs '()' 2>/dev/null; do\r
+>                      sleep 1\r
+> -- \r
+> 1.7.6\r
+> \r