From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 65C78429E32 for ; Tue, 1 Nov 2011 12:50:23 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 XF8DWXVIJ1ae for ; Tue, 1 Nov 2011 12:50:21 -0700 (PDT) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 751B8429E2F for ; Tue, 1 Nov 2011 12:50:20 -0700 (PDT) Received: by mail-wy0-f181.google.com with SMTP id 8so2012948wyg.26 for ; Tue, 01 Nov 2011 12:50:20 -0700 (PDT) Received: by 10.227.59.213 with SMTP id m21mr1214177wbh.19.1320177019985; Tue, 01 Nov 2011 12:50:19 -0700 (PDT) Received: from localhost ([109.131.187.47]) by mx.google.com with ESMTPS id fr4sm94158wbb.0.2011.11.01.12.50.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 Nov 2011 12:50:19 -0700 (PDT) From: Pieter Praet To: notmuch@notmuchmail.org Subject: [PATCH 2/4] test: add 'Emacs' prereq to dependent 'crypto' tests Date: Tue, 1 Nov 2011 20:49:12 +0100 Message-Id: <1320176954-4897-3-git-send-email-pieter@praet.org> X-Mailer: git-send-email 1.7.7.1 In-Reply-To: <1320176954-4897-1-git-send-email-pieter@praet.org> References: <1320176954-4897-1-git-send-email-pieter@praet.org> 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: Tue, 01 Nov 2011 19:50:24 -0000 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. --- test/crypto | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/test/crypto b/test/crypto index 3795926..4a00c00 100755 --- a/test/crypto +++ b/test/crypto @@ -7,10 +7,21 @@ test_description='PGP/MIME signature verification and decryption' . ./test-lib.sh +# Emacs is a prereq. +test_expect_success "prereq: Emacs is present" "which emacs" \ + && test_set_prereq EMACS + # GnuPG is a prereq. test_expect_success "prereq: GnuPG is present" "which gpg" \ && test_set_prereq 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 @@ FINGERPRINT=$(gpg --no-tty --list-secret-keys --with-colons --fingerprint | grep # 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." \ @@ -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" \ @@ -268,7 +279,7 @@ test_expect_equal GPG \ "$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" \ -- 1.7.7.1