[PATCH v3 5/7] test: add function to explicitly check for external dependencies
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Sun, 27 Nov 2011 18:36:17 +0000 (22:36 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:26 +0000 (09:40 -0800)
26/7b2b67499aa7fa013b83f365163f83f1f316a6 [new file with mode: 0644]

diff --git a/26/7b2b67499aa7fa013b83f365163f83f1f316a6 b/26/7b2b67499aa7fa013b83f365163f83f1f316a6
new file mode 100644 (file)
index 0000000..7ac0e67
--- /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 5B202429E2E\r
+       for <notmuch@notmuchmail.org>; Sun, 27 Nov 2011 10:36:55 -0800 (PST)\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 nIsUb2ANpD2D for <notmuch@notmuchmail.org>;\r
+       Sun, 27 Nov 2011 10:36:54 -0800 (PST)\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 505AE429E28\r
+       for <notmuch@notmuchmail.org>; Sun, 27 Nov 2011 10:36:54 -0800 (PST)\r
+Received: by mail-bw0-f53.google.com with SMTP id q10so8006916bka.26\r
+       for <notmuch@notmuchmail.org>; Sun, 27 Nov 2011 10:36:54 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=MYEfKUu9RreAzy70Q8KazGqbw0jC3RgnIW6FcZereO4=;\r
+       b=c393Zz8hIRUFRMKlxDBfpOETCQ4C0DHPmFgfDkI7zwfsH5ZIjH+y2tX+1DUgwZriuM\r
+       FeIubXZF5KCTzANsVeUK/uiY8zWJpIhUhdmP74psUf0FrDR2z4EbNOIRsN4GP3sh+X95\r
+       JpJCJ02DD7EQhjwSysvPzObf8MmKPoaFR3uVE=\r
+Received: by 10.205.126.13 with SMTP id gu13mr42235634bkc.114.1322419014021;\r
+       Sun, 27 Nov 2011 10:36:54 -0800 (PST)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id cc2sm25119627bkb.8.2011.11.27.10.36.53\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sun, 27 Nov 2011 10:36:53 -0800 (PST)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 5/7] test: add function to explicitly check for external\r
+       dependencies\r
+Date: Sun, 27 Nov 2011 22:36:17 +0400\r
+Message-Id: <1322418979-19180-6-git-send-email-dmitry.kurochkin@gmail.com>\r
+X-Mailer: git-send-email 1.7.7.3\r
+In-Reply-To: <1322418979-19180-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <87pqgd7d23.fsf@rocinante.cs.unb.ca>\r
+       <1322418979-19180-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: Sun, 27 Nov 2011 18:36:55 -0000\r
+\r
+Useful when binary is called indirectly (e.g. from emacs).\r
+---\r
+ test/test-lib.sh |   14 ++++++++++++++\r
+ 1 files changed, 14 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+index fe80e89..2422e32 100644\r
+--- a/test/test-lib.sh\r
++++ b/test/test-lib.sh\r
+@@ -555,12 +555,26 @@ test_declare_external_prereq () {\r
\r
+       hash $binary 2>/dev/null || eval "\r
+ $binary () {\r
++      test_missing_external_prereq_${binary}_=t\r
+       echo -n \"\$test_subtest_missing_external_prereqs_\" | grep -e \" $name \" ||\r
+       test_subtest_missing_external_prereqs_=\"$test_subtest_missing_external_prereqs_ $name\"\r
+       false\r
+ }"\r
+ }\r
\r
++# Explicitly require external prerequisite.  Useful when binary is\r
++# called indirectly (e.g. from emacs).\r
++# Returns success if dependency is available, failure otherwise.\r
++test_require_external_prereq () {\r
++      binary="$1"\r
++      if [ "$(eval echo -n \$test_missing_external_prereq_${binary}_)" = t ]; then\r
++              # dependency is missing, call the replacement function to note it\r
++              eval "$binary"\r
++      else\r
++              true\r
++      fi\r
++}\r
++\r
+ # You are not expected to call test_ok_ and test_failure_ directly, use\r
+ # the text_expect_* functions instead.\r
\r
+-- \r
+1.7.7.3\r
+\r