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 78C1C429E21 for ; Mon, 3 Oct 2011 09:48:49 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" 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 YlWU2EAbLnzW for ; Mon, 3 Oct 2011 09:48:48 -0700 (PDT) Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222]) by olra.theworths.org (Postfix) with ESMTP id A12D1429E29 for ; Mon, 3 Oct 2011 09:48:45 -0700 (PDT) Received: from localhost.localdomain (thor.loria.fr [152.81.12.250]) by ks3536.kimsufi.com (Postfix) with ESMTPSA id 3EA986A06B4; Mon, 3 Oct 2011 18:48:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net; s=key-schnouki; t=1317660524; bh=X+Q6BT3OrKQc6B9LlF8eovfLrx8ierHb3GZgfye6X24=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: In-Reply-To:References; b=SDZGkTArTRpCghBjpmrkxVNTncRxZVxQT2yZ8JdXqE8G+ZmTmi277fEcn0hyTb8wR 5SNl9efoZ0GxEUdIOEBdeJv140XB7RuUpVB6NPDDFagNrlNl6HvgaWSdDYew1Quw9N oNWIdaQ7o56l3iWssweYe9zMKtaufwqGWfZfQBg4= From: Thomas Jost To: notmuch@notmuchmail.org Subject: [PATCH 06/13] test: run emacs inside screen Date: Mon, 3 Oct 2011 18:47:20 +0200 Message-Id: <1317660447-27520-7-git-send-email-schnouki@schnouki.net> X-Mailer: git-send-email 1.7.6.4 In-Reply-To: <1317660447-27520-1-git-send-email-schnouki@schnouki.net> References: <1317660447-27520-1-git-send-email-schnouki@schnouki.net> In-Reply-To: <871uuuywtt.fsf@convex-new.cs.unb.ca> References: <871uuuywtt.fsf@convex-new.cs.unb.ca> 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: Mon, 03 Oct 2011 16:48:49 -0000 From: Dmitry Kurochkin Before the change, emacs run in daemon mode without any visible buffers. Turns out that this affects emacs behavior in some cases. In particular, `window-end' function returns `point-max' instead of the last visible position. That makes it hard or impossible to implement some tests. The patch runs emacs in a detached screen(1) session. So that it works exactly as if it has a visible window. Note: screen terminates when emacs exits. So the patch does not introduce new "running processes left behind" issues. --- test/test-lib.sh | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index 8e16a7e..f9fd73e 100755 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -852,14 +852,22 @@ EOF test_emacs () { if [ -z "$EMACS_SERVER" ]; then + # start a detached screen session with an emacs server + which screen &>/dev/null || return EMACS_SERVER="notmuch-test-suite-$$" - "$TMP_DIRECTORY/run_emacs" \ - --daemon \ + 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 + # wait until the emacs server is up + until test_emacs '()' 2>/dev/null; do + sleep 1 + done + fi + if [ "$EMACS_SERVER" ]; then + emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)" fi - - emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)" } -- 1.7.6.4