[PATCH v2 1/7] test: run emacs inside screen
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Fri, 1 Jul 2011 04:55:16 +0000 (08:55 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:53 +0000 (09:38 -0800)
76/2f694571b42819aef7e26c9b435a1c28900670 [new file with mode: 0644]

diff --git a/76/2f694571b42819aef7e26c9b435a1c28900670 b/76/2f694571b42819aef7e26c9b435a1c28900670
new file mode 100644 (file)
index 0000000..ff79cce
--- /dev/null
@@ -0,0 +1,99 @@
+Return-Path: <dmitry.kurochkin@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id A688B421192\r
+       for <notmuch@notmuchmail.org>; Thu, 30 Jun 2011 21:55:34 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id eAZ7DnRrZJeD for <notmuch@notmuchmail.org>;\r
+       Thu, 30 Jun 2011 21:55:34 -0700 (PDT)\r
+Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
+       [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 02AF642118E\r
+       for <notmuch@notmuchmail.org>; Thu, 30 Jun 2011 21:55:33 -0700 (PDT)\r
+Received: by mail-bw0-f53.google.com with SMTP id 12so2682445bwg.26\r
+       for <notmuch@notmuchmail.org>; Thu, 30 Jun 2011 21:55:33 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=4YPNwS2Xs30PUOBA3RY8YnfRE1Tb5gszO9XJGQBO2LE=;\r
+       b=xMgLKtfbTfLVW9h70j4/kSvvRTd0UeRSwqHk7e+RdsUbJNhHbC8D40jLt8sXUIMUST\r
+       GU4lKKgv3ocur+/9uDsA5hUD+gYHtbId47gBcAjqvBlDfIrMaX9+eGzE5SuQPy4qyzvk\r
+       3OYxj0neJyU25E09gcdzkaZeejzY24m1AXiyw=\r
+Received: by 10.204.138.142 with SMTP id a14mr2568160bku.195.1309496133628;\r
+       Thu, 30 Jun 2011 21:55:33 -0700 (PDT)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id e16sm2003358bke.18.2011.06.30.21.55.31\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Thu, 30 Jun 2011 21:55:32 -0700 (PDT)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 1/7] test: run emacs inside screen\r
+Date: Fri,  1 Jul 2011 08:55:16 +0400\r
+Message-Id: <1309496122-4965-2-git-send-email-dmitry.kurochkin@gmail.com>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <1309496122-4965-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <1309376558-26284-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+       <1309496122-4965-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 01 Jul 2011 04:55:34 -0000\r
+\r
+Before the change, emacs run in daemon mode without any visible\r
+buffers.  Turns out that this affects emacs behavior in some\r
+cases.  In particular, `window-end' function returns `point-max'\r
+instead of the last visible position.  That makes it hard or\r
+impossible to implement some tests.  The patch runs emacs in a\r
+detached screen(1) session.  So that it works exactly as if it\r
+has a visible window.\r
+\r
+Note: screen terminates when emacs exits.  So the patch does not\r
+introduce new "running processes left behind" issues.\r
+---\r
+ test/test-lib.sh |   10 ++++++++--\r
+ 1 files changed, 8 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+index 22e387e..688598c 100755\r
+--- a/test/test-lib.sh\r
++++ b/test/test-lib.sh\r
+@@ -858,10 +858,16 @@ EOF\r
+ test_emacs () {\r
+       if [ -z "$EMACS_SERVER" ]; then\r
+               EMACS_SERVER="notmuch-test-suite-$$"\r
+-              "$TMP_DIRECTORY/run_emacs" \\r
+-                      --daemon \\r
++              # start a detached screen session with an emacs server\r
++              screen -S "$EMACS_SERVER" -d -m "$TMP_DIRECTORY/run_emacs" \\r
++                      --no-window-system \\r
+                       --eval "(setq server-name \"$EMACS_SERVER\")" \\r
++                      --eval '(server-start)' \\r
+                       --eval "(orphan-watchdog $$)" || return\r
++              # wait until the emacs server is up\r
++              until test_emacs '()' 2>/dev/null; do\r
++                      sleep 1\r
++              done\r
+       fi\r
\r
+       emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)"\r
+-- \r
+1.7.5.4\r
+\r