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 1289742118E for ; Wed, 29 Jun 2011 12:42:49 -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 jOb2lcxdM+X3 for ; Wed, 29 Jun 2011 12:42:47 -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 437D6421186 for ; Wed, 29 Jun 2011 12:42:47 -0700 (PDT) Received: by bwg12 with SMTP id 12so1456477bwg.26 for ; Wed, 29 Jun 2011 12:42:45 -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; bh=DXeJ8xscgeeP8aDKoXUlubzj57/+JUc3bjUJeMmcA08=; b=NweTFQuaJy9wxaj43QEe/pA0Grixpiv8Pcg28ab/TF8a7M3bxRTQZYgWNbGdzF3Rxg zoH7Gj5kE8VGLygvEwtk745b135zz76BgwteCm5ToW3m4zIzBAUDefvBpLsN9o24fvJw QK1WcqIP653OIlTB5nRLHNO6ihT19ruuviVGU= Received: by 10.204.32.207 with SMTP id e15mr1128218bkd.60.1309376565762; Wed, 29 Jun 2011 12:42:45 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id o3sm1437581bka.0.2011.06.29.12.42.44 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Jun 2011 12:42:45 -0700 (PDT) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH 1/6] test: run emacs inside screen Date: Wed, 29 Jun 2011 23:42:33 +0400 Message-Id: <1309376558-26284-1-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.5.4 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, 29 Jun 2011 19:42:49 -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 079d7db..8d7c98d 100755 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -873,10 +873,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 '()'; do + sleep 1 + done fi emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)" -- 1.7.5.4