[PATCH 1/1] test/test-lib.sh: use vt100 as dtach terminal if TERM nonexistent or...
authorTomi Ollila <tomi.ollila@iki.fi>
Thu, 24 Jan 2013 07:09:20 +0000 (09:09 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:53:20 +0000 (09:53 -0800)
39/8ff002d60fb490f69331bdc29cf55381b86e92 [new file with mode: 0644]

diff --git a/39/8ff002d60fb490f69331bdc29cf55381b86e92 b/39/8ff002d60fb490f69331bdc29cf55381b86e92
new file mode 100644 (file)
index 0000000..806bc6c
--- /dev/null
@@ -0,0 +1,104 @@
+Return-Path: <too@guru-group.fi>\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 EB7CB431FAF\r
+       for <notmuch@notmuchmail.org>; Wed, 23 Jan 2013 23:09:36 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       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 0GdBhKY1UYND for <notmuch@notmuchmail.org>;\r
+       Wed, 23 Jan 2013 23:09:35 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 7F3ED431FAE\r
+       for <notmuch@notmuchmail.org>; Wed, 23 Jan 2013 23:09:35 -0800 (PST)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id 4C70E100086; Thu, 24 Jan 2013 09:09:23 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/1] test/test-lib.sh: use vt100 as dtach terminal if TERM\r
+       nonexistent or dumb\r
+Date: Thu, 24 Jan 2013 09:09:20 +0200\r
+Message-Id: <1359011360-15591-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.8.0\r
+In-Reply-To: <1358933736-300-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1358933736-300-1-git-send-email-tomi.ollila@iki.fi>\r
+Cc: tomi.ollila@iki.fi\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: Thu, 24 Jan 2013 07:09:37 -0000\r
+\r
+The TERM environment variable is set to 'dumb' when running tests, but\r
+the original value of it is stored for echoing colors and running emacs\r
+(somewhat interactively) in detached session. Emacs requires some\r
+terminal control sequences to be available for interactive operation.\r
+In case original TERM is (also) 'dumb' (or nonexistent) emacs cannot run\r
+interactively. To fix this problem dtach (and emacs as it's child\r
+process) is run with TERM=vt100 in case original TERM was nonexistent or\r
+dumb. This way there is a chance to run emacs tests with different user\r
+terminals and potentially find problems there.\r
+---\r
+\r
+Obsoletes id:1358933736-300-1-git-send-email-tomi.ollila@iki.fi\r
+\r
+The 2 typos Jani mentioned fixed (Thanks; I noticed the former but\r
+not the latter)\r
+\r
+Diffdiff of the content changes (in git format-patch generated files):\r
+\r
+: @@ -8 +8 @@\r
+: -the original value of it is stored for echoing colors and running (emacs\r
+: +the original value of it is stored for echoing colors and running emacs\r
+: @@ -40 +40 @@\r
+: -+           # user's TERM (or 'vt100' om case user's term is nonexistent\r
+: ++           # user's TERM (or 'vt100' in case user's term is nonexistent\r
+\r
+ test/test-lib.sh | 9 +++++++--\r
+ 1 file changed, 7 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+index 6ce3b31..1567178 100644\r
+--- a/test/test-lib.sh\r
++++ b/test/test-lib.sh\r
+@@ -41,6 +41,10 @@ esac\r
+ # Keep the original TERM for say_color and test_emacs\r
+ ORIGINAL_TERM=$TERM\r
\r
++# dtach(1) provides more capable terminal environment to anything\r
++# that requires more than dumb terminal...\r
++[ x"${TERM:-dumb}" = xdumb ] && DTACH_TERM=vt100 || DTACH_TERM=$TERM\r
++\r
+ # For repeatability, reset the environment to known value.\r
+ LANG=C\r
+ LC_ALL=C\r
+@@ -996,9 +1000,10 @@ test_emacs () {\r
+               fi\r
+               server_name="notmuch-test-suite-$$"\r
+               # start a detached session with an emacs server\r
+-              # user's TERM is given to dtach which assumes a minimally\r
++              # user's TERM (or 'vt100' in case user's term is nonexistent\r
++              # or 'dumb') is given to dtach which assumes a minimally\r
+               # VT100-compatible terminal -- and emacs inherits that\r
+-              TERM=$ORIGINAL_TERM dtach -n "$TEST_TMPDIR/emacs-dtach-socket.$$" \\r
++              TERM=$DTACH_TERM dtach -n "$TEST_TMPDIR/emacs-dtach-socket.$$" \\r
+                       sh -c "stty rows 24 cols 80; exec '$TMP_DIRECTORY/run_emacs' \\r
+                               --no-window-system \\r
+                               $load_emacs_tests \\r
+-- \r
+1.8.0\r
+\r