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 A688B421192 for ; Thu, 30 Jun 2011 21:55:34 -0700 (PDT) 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 eAZ7DnRrZJeD for ; Thu, 30 Jun 2011 21:55:34 -0700 (PDT) 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 02AF642118E for ; Thu, 30 Jun 2011 21:55:33 -0700 (PDT) Received: by mail-bw0-f53.google.com with SMTP id 12so2682445bwg.26 for ; Thu, 30 Jun 2011 21:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=4YPNwS2Xs30PUOBA3RY8YnfRE1Tb5gszO9XJGQBO2LE=; b=xMgLKtfbTfLVW9h70j4/kSvvRTd0UeRSwqHk7e+RdsUbJNhHbC8D40jLt8sXUIMUST GU4lKKgv3ocur+/9uDsA5hUD+gYHtbId47gBcAjqvBlDfIrMaX9+eGzE5SuQPy4qyzvk 3OYxj0neJyU25E09gcdzkaZeejzY24m1AXiyw= Received: by 10.204.138.142 with SMTP id a14mr2568160bku.195.1309496133628; Thu, 30 Jun 2011 21:55:33 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id e16sm2003358bke.18.2011.06.30.21.55.31 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 30 Jun 2011 21:55:32 -0700 (PDT) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH v2 1/7] test: run emacs inside screen Date: Fri, 1 Jul 2011 08:55:16 +0400 Message-Id: <1309496122-4965-2-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1309496122-4965-1-git-send-email-dmitry.kurochkin@gmail.com> References: <1309376558-26284-1-git-send-email-dmitry.kurochkin@gmail.com> <1309496122-4965-1-git-send-email-dmitry.kurochkin@gmail.com> 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: Fri, 01 Jul 2011 04:55:34 -0000 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 | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index 22e387e..688598c 100755 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -858,10 +858,16 @@ EOF test_emacs () { if [ -z "$EMACS_SERVER" ]; then EMACS_SERVER="notmuch-test-suite-$$" - "$TMP_DIRECTORY/run_emacs" \ - --daemon \ + # start a detached screen session with an emacs server + 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 emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)" -- 1.7.5.4