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 26ABE429E2F for ; Sun, 27 Nov 2011 10:36:54 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 0tQeteFoVGHO for ; Sun, 27 Nov 2011 10:36:52 -0800 (PST) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 35F92429E28 for ; Sun, 27 Nov 2011 10:36:50 -0800 (PST) Received: by mail-bw0-f53.google.com with SMTP id q10so8006916bka.26 for ; Sun, 27 Nov 2011 10:36:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references; bh=fpUIrrWQUT2UqlOJp2Rc/AaKU2Ky4tGXIZ8otRxwNcE=; b=VcNqy57Sx3hIKOJ27cZ6V1Rj8+P+zgaMlWIS+5Ex6WoNXXY6DNTtFtQh6t4chBvrjc /wWX71T6JhcphXdesufw1tmL/WzWZxQzE7R0l2D7hc0QfxMtEUL1TzYWVnNsktipUpnR TYMKQqIlZYvvw79yUHic3k/YDbb1Ev5Tutf3w= Received: by 10.205.127.142 with SMTP id ha14mr41233871bkc.116.1322419009902; Sun, 27 Nov 2011 10:36:49 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id hy13sm25145227bkc.0.2011.11.27.10.36.48 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Nov 2011 10:36:49 -0800 (PST) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH v3 3/7] test: skip all subtests if external dependencies are missing during init Date: Sun, 27 Nov 2011 22:36:15 +0400 Message-Id: <1322418979-19180-4-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1322418979-19180-1-git-send-email-dmitry.kurochkin@gmail.com> References: <87pqgd7d23.fsf@rocinante.cs.unb.ca> <1322418979-19180-1-git-send-email-dmitry.kurochkin@gmail.com> 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: Sun, 27 Nov 2011 18:36:54 -0000 Some tests (e.g. crypto) do a common initialization required for all subtests. The patch adds a check for missing external dependencies during this initialization. If any prerequisites are missing, all subtests are skipped. The check is run on the first call of test_reset_state_ function, so no changes for the tests are needed. --- test/test-lib.sh | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index df867a5..99b9e8b 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -902,10 +902,20 @@ test_emacs () { } test_reset_state_ () { + test -z "$test_init_done_" && test_init_ + test_subtest_known_broken_= test_subtest_missing_external_prereqs_= } +# called once before the first subtest +test_init_ () { + test_init_done_=t + + # skip all tests if there were external prerequisites missing during init + test_check_missing_external_prereqs_ "all tests in $this_test" && test_done +} + find_notmuch_path () { -- 1.7.7.3