Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 8626B429E21 for ; Thu, 17 Nov 2011 01:43:43 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 p0VAmz9VGSQ4 for ; Thu, 17 Nov 2011 01:43:41 -0800 (PST) Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id E685A431FD0 for ; Thu, 17 Nov 2011 01:43:40 -0800 (PST) Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pAH9ha5w008495; Thu, 17 Nov 2011 11:43:37 +0200 From: Tomi Ollila To: Dmitry Kurochkin , notmuch@notmuchmail.org Subject: Re: [PATCH 8/9] test: check if emacs is available in the beginning of test_emacs In-Reply-To: <1321494986-18998-9-git-send-email-dmitry.kurochkin@gmail.com> References: <1321494986-18998-1-git-send-email-dmitry.kurochkin@gmail.com> <1321494986-18998-9-git-send-email-dmitry.kurochkin@gmail.com> User-Agent: Notmuch/0.9+73~ged20210 (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) X-Face: HhBM'cA~ 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: Thu, 17 Nov 2011 09:43:43 -0000 On Thu, 17 Nov 2011 05:56:25 +0400, Dmitry Kurochkin wrote: > Unfortunately, this is needed to avoid the emacs waiting loop. > --- > test/test-lib.sh | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) [ context reduced ] > diff --git a/test/test-lib.sh b/test/test-lib.sh > index 840c86c..5bd5bd6 100755 > --- a/test/test-lib.sh > +++ b/test/test-lib.sh I have to patch the full set to my clone of the repo and do fuller review, but until that... > test_emacs () { > + # test dependencies beforehand to avoid the waiting loop below > + which emacs >/dev/null || emacs || return > + which emacsclient >/dev/null || emacsclient || return > + If emacs not found using which (what happened to hash), then try to execute emacs (??) and if that fails return. Same thing with emacsclient. In case of emacs: DISPLAY set, TERM=dumb -- emacs starts interactively on my desktop; grep DISPLAY test/* yields nothing. (maybe we should unset DISPLAY for tests ?). And, if DISPLAY unset, emacs exits with nonzero value, making || return happen anyway. ... and this is tested every time test_emacs() is executed... > if [ -z "$EMACS_SERVER" ]; then > server_name="notmuch-test-suite-$$" > -- > 1.7.7.2 Tomi