Re: [PATCH 1/1] test/test-lib.sh: use vt100 as dtach terminal if TERM nonexistent...
authorJani Nikula <jani@nikula.org>
Wed, 23 Jan 2013 17:25:39 +0000 (19:25 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:53:20 +0000 (09:53 -0800)
c7/9d4fff8a4f887877f85486b3d6ebd9e5fad9c4 [new file with mode: 0644]

diff --git a/c7/9d4fff8a4f887877f85486b3d6ebd9e5fad9c4 b/c7/9d4fff8a4f887877f85486b3d6ebd9e5fad9c4
new file mode 100644 (file)
index 0000000..e2242e1
--- /dev/null
@@ -0,0 +1,134 @@
+Return-Path: <jani@nikula.org>\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 346D9431FD9\r
+       for <notmuch@notmuchmail.org>; Wed, 23 Jan 2013 09:25:49 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[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 J07Z3jpF00Ea for <notmuch@notmuchmail.org>;\r
+       Wed, 23 Jan 2013 09:25:48 -0800 (PST)\r
+Received: from mail-la0-f46.google.com (mail-la0-f46.google.com\r
+       [209.85.215.46]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 546E4431FAE\r
+       for <notmuch@notmuchmail.org>; Wed, 23 Jan 2013 09:25:48 -0800 (PST)\r
+Received: by mail-la0-f46.google.com with SMTP id fq12so6630168lab.33\r
+       for <notmuch@notmuchmail.org>; Wed, 23 Jan 2013 09:25:46 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=x-received:from:to:cc:subject:in-reply-to:references:user-agent\r
+       :date:message-id:mime-version:content-type:x-gm-message-state;\r
+       bh=vF41OE51BPGhq5L+CiRI4RdPpn1A1ysyWJ4A05+pDbI=;\r
+       b=KcwaMGvRzq6j0R3PR6wl9jn07dF8WoK8alttSwsdF6w9ubBOgwh13YL6bi6TK5XNPF\r
+       /zJpaMXKogFy6crQXxdEtieqoDMPJb6WXYWP8JhHKQDfJdfXNEqgHHZw7nfvNojOm5YI\r
+       x9OjtW80W+kWWRyEq02wxwA4RDPW6jNu0iprjspIfY02vdkiAy55c5gvPxUYg5m+X7BP\r
+       hk+ZFMM+vNzlK+cahi7VKvbLQQi3hv4hXPPPZpMAof8NdPiXVaJIW+UeduD9lfy9h/4D\r
+       zxq2Ri6+mF+x9stOwSpFrs3BZ339Byj/fr9twk3E+4bowzwaB7DHGFXu/vkVz5A0rKpu\r
+       +Y9g==\r
+X-Received: by 10.152.105.17 with SMTP id gi17mr2015177lab.46.1358961945413;\r
+       Wed, 23 Jan 2013 09:25:45 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.\r
+       [80.223.81.27])\r
+       by mx.google.com with ESMTPS id z4sm8676437lbn.17.2013.01.23.09.25.42\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Wed, 23 Jan 2013 09:25:44 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 1/1] test/test-lib.sh: use vt100 as dtach terminal if TERM\r
+       nonexistent or dumb\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
+User-Agent: Notmuch/0.14+255~gff3cc55 (http://notmuchmail.org) Emacs/24.2.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Wed, 23 Jan 2013 19:25:39 +0200\r
+Message-ID: <87fw1r6cbw.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-Gm-Message-State:\r
+ ALoCoQn47Iwi0uXp2SQ+5NynLm56NcJ/N/wZlG7DTLzpc9MpCh5xCMn0KDOmf9MCbzdJMOQYHujk\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: Wed, 23 Jan 2013 17:25:49 -0000\r
+\r
+On Wed, 23 Jan 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:\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
+\r
+Extra ( there?\r
+\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
+>  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..3bc67f7 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
+That's just a tiny bit more trickery than I usually like... but then\r
+it's shell after all... :)\r
+\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' om case user's term is nonexistent\r
+> +            # or 'dumb') is given to dtach which assumes a minimally\r
+\r
+Nitpick, s/om/in/\r
+\r
+Otherwise LGTM, and works as advertised.\r
+\r
+\r
+Jani.\r
+\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.1\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r