[PATCH 2/4] test: add 'Emacs' prereq to dependent 'crypto' tests
authorPieter Praet <pieter@praet.org>
Tue, 1 Nov 2011 19:49:12 +0000 (20:49 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:57 +0000 (09:39 -0800)
08/580be77cfad1c30082b4844b41fba51ace2758 [new file with mode: 0644]

diff --git a/08/580be77cfad1c30082b4844b41fba51ace2758 b/08/580be77cfad1c30082b4844b41fba51ace2758
new file mode 100644 (file)
index 0000000..3fc7c6b
--- /dev/null
@@ -0,0 +1,117 @@
+Return-Path: <pieter@praet.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 65C78429E32\r
+       for <notmuch@notmuchmail.org>; Tue,  1 Nov 2011 12:50:23 -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 XF8DWXVIJ1ae for <notmuch@notmuchmail.org>;\r
+       Tue,  1 Nov 2011 12:50:21 -0700 (PDT)\r
+Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com\r
+       [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 751B8429E2F\r
+       for <notmuch@notmuchmail.org>; Tue,  1 Nov 2011 12:50:20 -0700 (PDT)\r
+Received: by mail-wy0-f181.google.com with SMTP id 8so2012948wyg.26\r
+       for <notmuch@notmuchmail.org>; Tue, 01 Nov 2011 12:50:20 -0700 (PDT)\r
+Received: by 10.227.59.213 with SMTP id m21mr1214177wbh.19.1320177019985;\r
+       Tue, 01 Nov 2011 12:50:19 -0700 (PDT)\r
+Received: from localhost ([109.131.187.47])\r
+       by mx.google.com with ESMTPS id fr4sm94158wbb.0.2011.11.01.12.50.19\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Tue, 01 Nov 2011 12:50:19 -0700 (PDT)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/4] test: add 'Emacs' prereq to dependent 'crypto' tests\r
+Date: Tue,  1 Nov 2011 20:49:12 +0100\r
+Message-Id: <1320176954-4897-3-git-send-email-pieter@praet.org>\r
+X-Mailer: git-send-email 1.7.7.1\r
+In-Reply-To: <1320176954-4897-1-git-send-email-pieter@praet.org>\r
+References: <1320176954-4897-1-git-send-email-pieter@praet.org>\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: Tue, 01 Nov 2011 19:50:24 -0000\r
+\r
+Adds a new test that checks for the presence of 'emacs',\r
+and adds that test as a prereq to all subsequent tests\r
+that rely on Emacs.\r
+\r
+This causes tests with unmet dependencies to be skipped.\r
+\r
+---\r
+ test/crypto |   17 ++++++++++++++---\r
+ 1 files changed, 14 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/test/crypto b/test/crypto\r
+index 3795926..4a00c00 100755\r
+--- a/test/crypto\r
++++ b/test/crypto\r
+@@ -7,10 +7,21 @@\r
+ test_description='PGP/MIME signature verification and decryption'\r
+ . ./test-lib.sh\r
\r
++# Emacs is a prereq.\r
++test_expect_success "prereq: Emacs is present" "which emacs" \\r
++    && test_set_prereq EMACS\r
++\r
+ # GnuPG is a prereq.\r
+ test_expect_success "prereq: GnuPG is present" "which gpg" \\r
+     && test_set_prereq GPG\r
\r
++# Some tests have multiple prereqs, but the test_expect_* functions\r
++# accept only a single argument as prereq tag, and using test_have_prereq\r
++# in and around tests causes various errors for me, so a dirty workaround\r
++# will have to do for the time being.\r
++test_have_prereq EMACS && test_have_prereq GPG \\r
++    && test_set_prereq EMACS+GPG\r
++\r
\r
+ add_gnupg_home ()\r
+ {\r
+@@ -36,7 +47,7 @@ FINGERPRINT=$(gpg --no-tty --list-secret-keys --with-colons --fingerprint | grep\r
+ # although I can't figure out why\r
+ add_email_corpus\r
\r
+-test_expect_success GPG 'emacs delivery of signed message' \\r
++test_expect_success EMACS+GPG 'emacs delivery of signed message' \\r
+ 'emacs_deliver_message \\r
+     "test signed message 001" \\r
+     "This is a test signed message." \\r
+@@ -146,7 +157,7 @@ mv "${GNUPGHOME}"{.bak,}\r
+ cat <<EOF >TESTATTACHMENT\r
+ This is a test file.\r
+ EOF\r
+-test_expect_success GPG 'emacs delivery of encrypted message with attachment' \\r
++test_expect_success EMACS+GPG 'emacs delivery of encrypted message with attachment' \\r
+ 'emacs_deliver_message \\r
+     "test encrypted message 001" \\r
+     "This is a test encrypted message.\n" \\r
+@@ -268,7 +279,7 @@ test_expect_equal GPG \\r
+     "$expected"\r
+ mv "${GNUPGHOME}"{.bak,}\r
\r
+-test_expect_success GPG 'emacs delivery of encrypted + signed message' \\r
++test_expect_success EMACS+GPG 'emacs delivery of encrypted + signed message' \\r
+ 'emacs_deliver_message \\r
+     "test encrypted message 002" \\r
+     "This is another test encrypted message.\n" \\r
+-- \r
+1.7.7.1\r
+\r