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