[PATCH 2/4] test: add 'GPG' prereq to 'crypto' tests

Pieter Praet pieter at praet.org
Fri May 13 01:17:14 PDT 2011


Signed-off-by: Pieter Praet <pieter at praet.org>
---
 test/crypto |   30 ++++++++++++++++++------------
 1 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/test/crypto b/test/crypto
index 961d035..c2f381c 100755
--- a/test/crypto
+++ b/test/crypto
@@ -7,6 +7,12 @@
 test_description='PGP/MIME signature verification and decryption'
 . ./test-lib.sh
 
+# GnuPG is a prereq.
+if test_expect_success "prereq: GnuPG is present" "which gpg"; then
+    test_set_prereq GPG
+fi
+
+
 add_gnupg_home ()
 {
     local output
@@ -31,7 +37,7 @@ FINGERPRINT=$(gpg --no-tty --list-secret-keys --with-colons --fingerprint | grep
 # although I can't figure out why
 add_email_corpus
 
-test_expect_success 'emacs delivery of signed message' \
+test_expect_success GPG 'emacs delivery of signed message' \
 'emacs_deliver_message \
     "test signed message 001" \
     "This is a test signed message." \
@@ -66,7 +72,7 @@ expected='[[[{"id": "XXXXX",
  "content-type": "application/pgp-signature"}]}
 ]},
  []]]]'
-test_expect_equal \
+test_expect_equal GPG \
     "$output" \
     "$expected"
 
@@ -103,7 +109,7 @@ expected='[[[{"id": "XXXXX",
  "content-type": "application/pgp-signature"}]}
 ]},
  []]]]'
-test_expect_equal \
+test_expect_equal GPG \
     "$output" \
     "$expected"
 
@@ -139,7 +145,7 @@ expected='[[[{"id": "XXXXX",
  "content-type": "application/pgp-signature"}]}
 ]},
  []]]]'
-test_expect_equal \
+test_expect_equal GPG \
     "$output" \
     "$expected"
 mv "${GNUPGHOME}"{.bak,}
@@ -148,7 +154,7 @@ mv "${GNUPGHOME}"{.bak,}
 cat <<EOF >TESTATTACHMENT
 This is a test file.
 EOF
-test_expect_success 'emacs delivery of encrypted message with attachment' \
+test_expect_success GPG 'emacs delivery of encrypted message with attachment' \
 'emacs_deliver_message \
     "test encrypted message 001" \
     "This is a test encrypted message." \
@@ -186,7 +192,7 @@ expected='[[[{"id": "XXXXX",
  "filename": "TESTATTACHMENT"}]}
 ]}]},
  []]]]'
-test_expect_equal \
+test_expect_equal GPG \
     "$output" \
     "$expected"
 
@@ -195,7 +201,7 @@ notmuch show \
     --format=part --part=4 \
     --decrypt \
     subject:"test encrypted message 001" >OUTPUT
-test_expect_equal_file OUTPUT TESTATTACHMENT
+test_expect_equal_file GPG OUTPUT TESTATTACHMENT
 
 test_begin_subtest "decryption failure with missing key"
 mv "${GNUPGHOME}"{,.bak}
@@ -224,12 +230,12 @@ expected='[[[{"id": "XXXXX",
  "content-type": "application/octet-stream"}]}
 ]},
  []]]]'
-test_expect_equal \
+test_expect_equal GPG \
     "$output" \
     "$expected"
 mv "${GNUPGHOME}"{.bak,}
 
-test_expect_success 'emacs delivery of encrypted/signed message' \
+test_expect_success GPG 'emacs delivery of encrypted/signed message' \
 'emacs_deliver_message \
     "test encrypted message 002" \
     "This is a test encrypted message." \
@@ -263,7 +269,7 @@ expected='[[[{"id": "XXXXX",
  "content-type": "text/plain",
  "content": "This is a test encrypted message.\n"}]}]},
  []]]]'
-test_expect_equal \
+test_expect_equal GPG \
     "$output" \
     "$expected"
 
@@ -275,7 +281,7 @@ Subject: Re: test encrypted message 002
 
 On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite at notmuchmail.org> wrote:
 > This is a test encrypted message.'
-test_expect_equal \
+test_expect_equal GPG \
     "$output" \
     "$expected"
 
@@ -319,7 +325,7 @@ expected='[[[{"id": "XXXXX",
  "content-type": "application/pgp-signature"}]}
 ]},
  []]]]'
-test_expect_equal \
+test_expect_equal GPG \
     "$output" \
     "$expected"
 
-- 
1.7.4.1



More information about the notmuch mailing list