Re: [PATCH v2 2/5] test: Made T010-help-test and T020-compact tests more portable.
authorJani Nikula <jani@nikula.org>
Fri, 30 May 2014 07:49:16 +0000 (10:49 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:03:04 +0000 (10:03 -0800)
d2/a42fdf996611478114642f3f746e5841002157 [new file with mode: 0644]

diff --git a/d2/a42fdf996611478114642f3f746e5841002157 b/d2/a42fdf996611478114642f3f746e5841002157
new file mode 100644 (file)
index 0000000..9c33299
--- /dev/null
@@ -0,0 +1,159 @@
+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 24AF8431FBD\r
+       for <notmuch@notmuchmail.org>; Fri, 30 May 2014 00:49:26 -0700 (PDT)\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 SYVjHv2s7Q5b for <notmuch@notmuchmail.org>;\r
+       Fri, 30 May 2014 00:49:22 -0700 (PDT)\r
+Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com\r
+ [74.125.82.43])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 2BF91431FAE   for <notmuch@notmuchmail.org>; Fri, 30 May 2014 00:49:22 -0700\r
+ (PDT)\r
+Received: by mail-wg0-f43.google.com with SMTP id l18so1527062wgh.2\r
+       for <notmuch@notmuchmail.org>; Fri, 30 May 2014 00:49:18 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:from:to:subject:in-reply-to:references\r
+       :user-agent:date:message-id:mime-version:content-type;\r
+       bh=XMUovLQbEXj++N6n6UTvvxNso4KR+mRd3vb35PfjXVY=;\r
+       b=UzNTjHjObIFY4ikRCymFfuxSG08mZYv+Hom1rp7PS6KOkoaGsPYmBnPFhqnndGI4fR\r
+       MPp9oVmWtCBWNHoPd55UIWaOjWpGpHFeH7I8euVdK0CzTZVY79+70SJMsqJvS+N7ktjt\r
+       G7mTraKKH2iWJwJ3sNvVsGJ7e9sAE8AWKxdhWxM+d4I4JfWGp2ePCyzB0/0j1HUyfBKf\r
+       6ez3skZjRoJOTFpounojDE+3mKnj0/j7ctAURY0iuHVCn4VTIteEVPEhNqm80PHHvTi+\r
+       lLbQ/oFyVey/QDa/+PZiRCE8d95UIv80TZZDhp+8v+cnYcShQoUCOGjvY+b6HClRzgK+\r
+       cisQ==\r
+X-Gm-Message-State:\r
+ ALoCoQkiCYHq8Q/onAsfWQrfUbSX0+0Hnf4BRGH7iJDWYpR370Uy/BtWvJSfLQbhpyamNiMc3oS3\r
+X-Received: by 10.180.77.70 with SMTP id q6mr4142832wiw.28.1401436158587;\r
+       Fri, 30 May 2014 00:49:18 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+       [88.195.111.91])\r
+       by mx.google.com with ESMTPSA id k2sm8056404wjq.20.2014.05.30.00.49.17\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+       Fri, 30 May 2014 00:49:17 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Charles Celerier <cceleri@cs.stanford.edu>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v2 2/5] test: Made T010-help-test and T020-compact tests\r
+       more    portable.\r
+In-Reply-To: <1399737224-79348-1-git-send-email-cceleri@cs.stanford.edu>\r
+References: <id:1399395748-44920-5-git-send-email-cceleri@cs.stanford.edu>\r
+       <1399737224-79348-1-git-send-email-cceleri@cs.stanford.edu>\r
+User-Agent: Notmuch/0.18+24~gfe8cd90 (http://notmuchmail.org) Emacs/24.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Fri, 30 May 2014 10:49:16 +0300\r
+Message-ID: <8761kn1zb7.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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, 30 May 2014 07:49:26 -0000\r
+\r
+On Sat, 10 May 2014, Charles Celerier <cceleri@cs.stanford.edu> wrote:\r
+> The tests T010-help-test and T020-compact use the files have-man and\r
+> have-compact, respectively, as indicators of how notmuch is configured.\r
+> These were symbolic links to true and false for use in bash tests.\r
+> Unfortunately, the paths to true and false may not be the same on all\r
+> platforms (e.g. on Mac OS X they are in /usr/bin), so hard-coding\r
+> symbolic links to /bin/true and /bin/false is not portable. This patch\r
+> writes a 1 to have-man and have-compact to indicate true, and a 0 to\r
+> indicate false, instead. The tests now read the contents of the file to\r
+> determine the truth value instead of following the symbolic link.\r
+\r
+Please see [1] and [2] for what I think a better alternative.\r
+\r
+BR,\r
+Jani.\r
+\r
+\r
+[1] id:1401435785-2894-1-git-send-email-jani@nikula.org\r
+[2] id:1401435785-2894-2-git-send-email-jani@nikula.org\r
+\r
+\r
+\r
+>\r
+> Signed-off-by: Charles Celerier <cceleri@cs.stanford.edu>\r
+> ---\r
+>  test/Makefile.local    | 8 ++++----\r
+>  test/T010-help-test.sh | 2 +-\r
+>  test/T020-compact.sh   | 2 +-\r
+>  3 files changed, 6 insertions(+), 6 deletions(-)\r
+>\r
+> diff --git a/test/Makefile.local b/test/Makefile.local\r
+> index d622eaf..8fd333c 100644\r
+> --- a/test/Makefile.local\r
+> +++ b/test/Makefile.local\r
+> @@ -37,16 +37,16 @@ $(dir)/parse-time: $(dir)/parse-time.o parse-time-string/parse-time-string.o\r
+>  \r
+>  $(dir)/have-compact: Makefile.config\r
+>  ifeq ($(HAVE_XAPIAN_COMPACT),1)\r
+> -    ln -sf /bin/true $@\r
+> +    echo 1 > $@\r
+>  else\r
+> -    ln -sf /bin/false $@\r
+> +    echo 0 > $@\r
+>  endif\r
+>  \r
+>  $(dir)/have-man: Makefile.config\r
+>  ifeq ($(HAVE_SPHINX)$(HAVE_RST2MAN),00)\r
+> -    ln -sf /bin/false $@\r
+> +    echo 0 > $@\r
+>  else\r
+> -    ln -sf /bin/true $@\r
+> +    echo 1 > $@\r
+>  endif\r
+>  \r
+>  .PHONY: test check\r
+> diff --git a/test/T010-help-test.sh b/test/T010-help-test.sh\r
+> index 77410bc..02162ca 100755\r
+> --- a/test/T010-help-test.sh\r
+> +++ b/test/T010-help-test.sh\r
+> @@ -7,7 +7,7 @@ test_expect_success 'notmuch --help' 'notmuch --help'\r
+>  test_expect_success 'notmuch help' 'notmuch help'\r
+>  test_expect_success 'notmuch --version' 'notmuch --version'\r
+>  \r
+> -if ${TEST_DIRECTORY}/have-man; then\r
+> +if grep -q 1 ${TEST_DIRECTORY}/have-man ; then\r
+>      test_expect_success 'notmuch --help tag' 'notmuch --help tag'\r
+>      test_expect_success 'notmuch help tag' 'notmuch help tag'\r
+>  else\r
+> diff --git a/test/T020-compact.sh b/test/T020-compact.sh\r
+> index 77bb963..0139584 100755\r
+> --- a/test/T020-compact.sh\r
+> +++ b/test/T020-compact.sh\r
+> @@ -10,7 +10,7 @@ notmuch tag +tag1 \*\r
+>  notmuch tag +tag2 subject:Two\r
+>  notmuch tag -tag1 +tag3 subject:Three\r
+>  \r
+> -if ! ${TEST_DIRECTORY}/have-compact; then\r
+> +if grep -q 0 ${TEST_DIRECTORY}/have-compact; then\r
+>      test_begin_subtest "Compact unsupported: error message"\r
+>      output=$(notmuch compact --quiet 2>&1)\r
+>      test_expect_equal "$output" "notmuch was compiled against a xapian version lacking compaction support.\r
+> -- \r
+> 1.8.5.2 (Apple Git-48)\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r