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 DD519429E28 for ; Thu, 17 Nov 2011 05:08:30 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 1.7 X-Spam-Level: * X-Spam-Status: No, score=1.7 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=2.499, 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 geGmkExSfXZR for ; Thu, 17 Nov 2011 05:08:30 -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 1A652429E27 for ; Thu, 17 Nov 2011 05:08:29 -0800 (PST) Received: by bkaq10 with SMTP id q10so2111154bka.26 for ; Thu, 17 Nov 2011 05:08:28 -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=wPeLnYXZa03krad0xZ8+t4I7R7kpE5CpjQNlW99kq8c=; b=B3odIqkuiJCccIuyH4HL+hUSgKlIfJeMXv/eMA4QJJU4CJn7SJ9Amfwyq/QYvW8OCG N1I6znUAqPBq1S2UnHsVq+YfvU3y7vIuiqb/nhIs2Sz7gEvttyVunM7I3ICwAzbrnbIS 1w5tp2N3JQQEWB8xMeiznGAx2//58zJilAWjs= Received: by 10.204.154.201 with SMTP id p9mr21354450bkw.33.1321535308764; Thu, 17 Nov 2011 05:08:28 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id e8sm41222670bkd.7.2011.11.17.05.08.27 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Nov 2011 05:08:28 -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: <87k46zngrf.fsf@gmail.com> References: <1321494986-18998-1-git-send-email-dmitry.kurochkin@gmail.com> <1321494986-18998-9-git-send-email-dmitry.kurochkin@gmail.com> <87k46zngrf.fsf@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 17:08:12 +0400 Message-ID: <8762iioq0z.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 13:08:31 -0000 On Thu, 17 Nov 2011 15:13:40 +0400, Dmitry Kurochkin wrote: > 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 > I have sent a new version of this patch series [1] which moves the above tricks into a dedicated function. Regards, Dmitry [1] id:"1321535163-4895-1-git-send-email-dmitry.kurochkin@gmail.com" > Regards, > Dmitry > > > > if [ -z "$EMACS_SERVER" ]; then > > > server_name="notmuch-test-suite-$$" > > > -- > > > 1.7.7.2 > > > > Tomi