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 C0870421164 for ; Wed, 16 Nov 2011 06:34:50 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] 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 33fZEhivAFAZ for ; Wed, 16 Nov 2011 06:34:49 -0800 (PST) Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222]) by olra.theworths.org (Postfix) with ESMTP id 905D5429E56 for ; Wed, 16 Nov 2011 06:34:25 -0800 (PST) Received: from thor.loria.fr (thor.loria.fr [152.81.12.250]) by ks3536.kimsufi.com (Postfix) with ESMTPSA id 83A036A002A; Wed, 16 Nov 2011 15:34:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net; s=key-schnouki; t=1321454064; bh=mChOB6pQ+roC9BfCnokNRE+0lPvDfqcd0E8WsvL7ZxQ=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=ZS2Be98rg/MbHgSqb22yL5Z2ZaYMwap12WZ7SvTO9v1g/RfpcTX6GfVHf7LhD3UJj od50idRZmQICb5bE29egF77LL2Ntyo0od8qmI12p5ZDfW7BUEcWMfZX3kRRHF6DJwY 3Lc3GngrbTlJp7VxMbaNiN0CvAQWcLszVNBTGy/E= From: Thomas Jost To: notmuch@notmuchmail.org Subject: [PATCH 2/6] test: check if emacs and dtach are available in test_emacs() Date: Wed, 16 Nov 2011 15:33:51 +0100 Message-Id: <1321454035-22023-3-git-send-email-schnouki@schnouki.net> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1321454035-22023-1-git-send-email-schnouki@schnouki.net> References: <1320176954-4897-1-git-send-email-pieter@praet.org> <1321454035-22023-1-git-send-email-schnouki@schnouki.net> 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, 16 Nov 2011 14:34:51 -0000 The test_emacs() function is run by the emacs tests even if the EMACS prereq is not available. This causes an issue when running the test suite on a system where dtach is not installed: the emacs server will not start, but since the $EMACS_SERVER variable is set on the first call to test_emacs, subsequent calls may result in attempts to run emacsclient, which will then report "can't find socket". This patch fixes this issue by making sure that dtach and emacs are available before doing anything else in test_emacs(). --- test/test-lib.sh | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index 382934f..ca1f412 100755 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -852,6 +852,10 @@ EOF } test_emacs () { + # First check that emacs and dtach are available + hash emacs &>/dev/null || return + hash dtach &>/dev/null || return + if [ -z "$EMACS_SERVER" ]; then EMACS_SERVER="notmuch-test-suite-$$" # start a detached session with an emacs server -- 1.7.7.3