Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 7FD40421166 for ; Wed, 16 Nov 2011 06:34:52 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id phxkASxHzcjV for ; Wed, 16 Nov 2011 06:34:50 -0800 (PST) Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222]) by olra.theworths.org (Postfix) with ESMTP id D2AC3429E58 for ; Wed, 16 Nov 2011 06:34:25 -0800 (PST) Received: from thor.loria.fr (thor.loria.fr [152.81.12.250]) by ks3536.kimsufi.com (Postfix) with ESMTPSA id DDE316A002C; Wed, 16 Nov 2011 15:34:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net; s=key-schnouki; t=1321454064; bh=UpbYv8MrjKGuZ+yuWOtfmJIxr/n5em/BQ38RznVn7IY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=R+ixtysqdBEKkeB5UIx6qwyCnfpk9eOMs1Y3WMxZKYwXeTcdmu1gllg0Zkct7gRsu HMwx/lWLpvu63DhXBvOdTcplLNaiDtbDmUzLTZeZUGPXBlRXknNPvgCkPZzNM4tLaO sizjbZj5/ufHyxr6p0+FbbjW9vtzVP4UtPX1Ie2s= From: Thomas Jost To: notmuch@notmuchmail.org Subject: [PATCH 4/6] test: add 'Emacs' prereq to dependent 'crypto' tests Date: Wed, 16 Nov 2011 15:33:53 +0100 Message-Id: <1321454035-22023-5-git-send-email-schnouki@schnouki.net> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1321454035-22023-1-git-send-email-schnouki@schnouki.net> References: <1320176954-4897-1-git-send-email-pieter@praet.org> <1321454035-22023-1-git-send-email-schnouki@schnouki.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 14:34:53 -0000 From: Pieter Praet Adds a new test that checks for the presence of 'emacs', and adds that test as a prereq to all subsequent tests that rely on Emacs. This causes tests with unmet dependencies to be skipped. Right now, all crypto tests do depend on Emacs, because it is used to generate the signed/encrypted messages that are needed by the tests. Signed-off-by: Pieter Praet --- test/crypto | 39 +++++++++++++++++++++++++-------------- 1 files changed, 25 insertions(+), 14 deletions(-) diff --git a/test/crypto b/test/crypto index eca59b6..085070b 100755 --- a/test/crypto +++ b/test/crypto @@ -7,9 +7,20 @@ test_description='PGP/MIME signature verification and decryption' . ./test-lib.sh +# Emacs is a prereq. +test_set_bin_prereq dtach "dtach" DTACH +test_have_prereq DTACH && test_set_bin_prereq emacs "Emacs" EMACS + # GnuPG is a prereq. test_set_bin_prereq gpg "GnuPG" GPG +# Some tests have multiple prereqs, but the test_expect_* functions +# accept only a single argument as prereq tag, and using test_have_prereq +# in and around tests causes various errors for me, so a dirty workaround +# will have to do for the time being. +test_have_prereq EMACS && test_have_prereq GPG \ + && test_set_prereq EMACS+GPG + add_gnupg_home () { @@ -36,7 +47,7 @@ test_have_prereq GPG && FINGERPRINT=$(gpg --no-tty --list-secret-keys --with-col # although I can't figure out why add_email_corpus -test_expect_success GPG 'emacs delivery of signed message' \ +test_expect_success EMACS+GPG 'emacs delivery of signed message' \ 'emacs_deliver_message \ "test signed message 001" \ "This is a test signed message." \ @@ -69,7 +80,7 @@ expected='[[[{"id": "XXXXX", {"id": 3, "content-type": "application/pgp-signature"}]}]}, []]]]' -test_expect_equal GPG \ +test_expect_equal EMACS+GPG \ "$output" \ "$expected" @@ -104,7 +115,7 @@ expected='[[[{"id": "XXXXX", {"id": 3, "content-type": "application/pgp-signature"}]}]}, []]]]' -test_expect_equal GPG \ +test_expect_equal EMACS+GPG \ "$output" \ "$expected" @@ -137,7 +148,7 @@ expected='[[[{"id": "XXXXX", {"id": 3, "content-type": "application/pgp-signature"}]}]}, []]]]' -test_expect_equal GPG \ +test_expect_equal EMACS+GPG \ "$output" \ "$expected" mv "${GNUPGHOME}"{.bak,} @@ -146,7 +157,7 @@ mv "${GNUPGHOME}"{.bak,} cat <TESTATTACHMENT This is a test file. EOF -test_expect_success GPG 'emacs delivery of encrypted message with attachment' \ +test_expect_success EMACS+GPG 'emacs delivery of encrypted message with attachment' \ 'emacs_deliver_message \ "test encrypted message 001" \ "This is a test encrypted message.\n" \ @@ -180,7 +191,7 @@ Non-text part: application/octet-stream part} body} message}' -test_expect_equal GPG \ +test_expect_equal EMACS+GPG \ "$output" \ "$expected" @@ -215,7 +226,7 @@ expected='[[[{"id": "XXXXX", "content-type": "application/octet-stream", "filename": "TESTATTACHMENT"}]}]}]}, []]]]' -test_expect_equal GPG \ +test_expect_equal EMACS+GPG \ "$output" \ "$expected" @@ -226,7 +237,7 @@ output=$(notmuch show --format=json --part=4 --decrypt subject:"test encrypted m expected='{"id": 4, "content-type": "text/plain", "content": "This is a test encrypted message.\n"}' -test_expect_equal GPG \ +test_expect_equal EMACS+GPG \ "$output" \ "$expected" @@ -236,7 +247,7 @@ notmuch show \ --part=5 \ --decrypt \ subject:"test encrypted message 001" >OUTPUT -test_expect_equal_file GPG OUTPUT TESTATTACHMENT +test_expect_equal_file EMACS+GPG OUTPUT TESTATTACHMENT test_begin_subtest "decryption failure with missing key" mv "${GNUPGHOME}"{,.bak} @@ -263,12 +274,12 @@ expected='[[[{"id": "XXXXX", {"id": 3, "content-type": "application/octet-stream"}]}]}, []]]]' -test_expect_equal GPG \ +test_expect_equal EMACS+GPG \ "$output" \ "$expected" mv "${GNUPGHOME}"{.bak,} -test_expect_success GPG 'emacs delivery of encrypted + signed message' \ +test_expect_success EMACS+GPG 'emacs delivery of encrypted + signed message' \ 'emacs_deliver_message \ "test encrypted message 002" \ "This is another test encrypted message.\n" \ @@ -303,7 +314,7 @@ expected='[[[{"id": "XXXXX", "content-type": "text/plain", "content": "This is another test encrypted message.\n"}]}]}, []]]]' -test_expect_equal GPG \ +test_expect_equal EMACS+GPG \ "$output" \ "$expected" @@ -315,7 +326,7 @@ Subject: Re: test encrypted message 002 On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite wrote: > This is another test encrypted message.' -test_expect_equal GPG \ +test_expect_equal EMACS+GPG \ "$output" \ "$expected" @@ -356,7 +367,7 @@ expected='[[[{"id": "XXXXX", {"id": 3, "content-type": "application/pgp-signature"}]}]}, []]]]' -test_expect_equal GPG \ +test_expect_equal EMACS+GPG \ "$output" \ "$expected" -- 1.7.7.3