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

diff --git a/31/29330263e53da17a02f33cb6769973906aef05 b/31/29330263e53da17a02f33cb6769973906aef05
new file mode 100644 (file)
index 0000000..05b19f6
--- /dev/null
@@ -0,0 +1,97 @@
+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 00134431FAF\r
+       for <notmuch@notmuchmail.org>; Wed, 23 Jan 2013 23:39:14 -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 GsroEie7YqDd for <notmuch@notmuchmail.org>;\r
+       Wed, 23 Jan 2013 23:39:14 -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 587B0431FAE\r
+       for <notmuch@notmuchmail.org>; Wed, 23 Jan 2013 23:39:14 -0800 (PST)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id 018AA100086; Thu, 24 Jan 2013 09:39:03 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH V3 1/1] test/test-lib.sh: use vt100 as dtach terminal if TERM\r
+       dumb or unset/empty\r
+Date: Thu, 24 Jan 2013 09:39:02 +0200\r
+Message-Id: <1359013142-3329-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.8.0\r
+In-Reply-To: <1359011360-15591-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1359011360-15591-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:39:15 -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 unset/empty) emacs cannot\r
+run interactively. To fix this problem dtach (and emacs as it's child\r
+process) is run with TERM=vt100 in case original TERM was unset, empty\r
+or 'dumb'. This way there is a chance to run emacs tests with different\r
+user terminals and potentially find problems there.\r
+---\r
+\r
+Obsoletes id:1359011360-15591-1-git-send-email-tomi.ollila@iki.fi\r
+\r
+To be accurate (instead of potentially confusing), the commit\r
+message and comments have been edited to mention 'unset or empty'\r
+instead of 'nonexistent'. No functional changes (to neither v1 or v2\r
+of this patch).\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 unset, empty\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