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 6CACD429E21 for ; Thu, 17 Nov 2011 03:13:58 -0800 (PST) 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 jXNsPAvr7heT for ; Thu, 17 Nov 2011 03:13:57 -0800 (PST) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 94D65431FD0 for ; Thu, 17 Nov 2011 03:13:57 -0800 (PST) Received: by bkaq10 with SMTP id q10so1977075bka.26 for ; Thu, 17 Nov 2011 03:13:56 -0800 (PST) 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=1FGcI3i0GtgV7hEeqjMGLeuCZADCaGyPPdRGTsudFUQ=; b=J9X5VL1pQ8oSJSE+E+Ol7+7NmT+ab2AlbcD7rH78PRiHt/Bhv5vqaQzRKDtNNm+YMA lCl2edUl/CwWShCh0IKGmchITTNY2HX3+ZqgCQ3eI4DysZaQqxaJDiPr36D4UTeaF2oC GkUBkd41VJUvuXmmIaDCXiipb4CqeJkjPXB70= Received: by 10.205.127.68 with SMTP id gz4mr32869513bkc.17.1321528436101; Thu, 17 Nov 2011 03:13:56 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id n19sm9154471bka.0.2011.11.17.03.13.55 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Nov 2011 03:13:55 -0800 (PST) From: Dmitry Kurochkin To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH 8/9] test: check if emacs is available in the beginning of test_emacs In-Reply-To: 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.10_rc1+9~g8270095 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Thu, 17 Nov 2011 15:13:40 +0400 Message-ID: <87k46zngrf.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: Thu, 17 Nov 2011 11:13:58 -0000 On Thu, 17 Nov 2011 11:43:36 +0200, Tomi Ollila wrote: > 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... > Either you did not apply other patches, or I made some stupid mistake. I am not very happy with the above lines. They feel hackish. Perhaps others would suggest something better. Here is a more detailed explanation of what they do (or should do): which emacs || # check that emacs binary exists (hash would succeed # for functions) emacs || # if the binary does not exist, run the "replacement" # function which would register the missing dependency return # and return with an error Regards, Dmitry > > if [ -z "$EMACS_SERVER" ]; then > > server_name="notmuch-test-suite-$$" > > -- > > 1.7.7.2 > > Tomi