From 6d6e848299cd5cf71dafd4cb0214ec8f6d574331 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Mon, 24 Mar 2014 22:46:32 +0200 Subject: [PATCH] Re: [PATCH v2] test: conditionally test compact depending on configured support --- 37/630368f2989a8bcfb395745b0a92910457946a | 119 ++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 37/630368f2989a8bcfb395745b0a92910457946a diff --git a/37/630368f2989a8bcfb395745b0a92910457946a b/37/630368f2989a8bcfb395745b0a92910457946a new file mode 100644 index 000000000..c79a45063 --- /dev/null +++ b/37/630368f2989a8bcfb395745b0a92910457946a @@ -0,0 +1,119 @@ +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 23304431FBD + for ; Mon, 24 Mar 2014 13:46:49 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 VI9SRTg7Nlp4 for ; + Mon, 24 Mar 2014 13:46:41 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 78E74431FB6 + for ; Mon, 24 Mar 2014 13:46:41 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 026F81000E5; + Mon, 24 Mar 2014 22:46:33 +0200 (EET) +From: Tomi Ollila +To: Jani Nikula , notmuch@notmuchmail.org +Subject: Re: [PATCH v2] test: conditionally test compact depending on + configured support +In-Reply-To: <1394645164-23561-1-git-send-email-jani@nikula.org> +References: + <1394645164-23561-1-git-send-email-jani@nikula.org> +User-Agent: Notmuch/0.17+156~g1203750 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +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: Mon, 24 Mar 2014 20:46:49 -0000 + +On Wed, Mar 12 2014, Jani Nikula wrote: + +> I still have one machine with old enough Xapian to not have compaction +> support. Make the tests check for unsupported compact operation when +> compact is not available. +> --- + +LGTM. + +Tomi + + +> test/Makefile.local | 8 ++++++++ +> test/T020-compact.sh | 11 +++++++++++ +> 2 files changed, 19 insertions(+) +> +> diff --git a/test/Makefile.local b/test/Makefile.local +> index 36b1c1b71de0..781420164105 100644 +> --- a/test/Makefile.local +> +++ b/test/Makefile.local +> @@ -35,9 +35,17 @@ $(dir)/symbol-test: $(dir)/symbol-test.o lib/$(LINKER_NAME) +> $(dir)/parse-time: $(dir)/parse-time.o parse-time-string/parse-time-string.o +> $(call quiet,CC) $^ -o $@ +> +> +$(dir)/have-compact: Makefile.config +> +ifeq ($(HAVE_XAPIAN_COMPACT),1) +> + ln -sf /bin/true $@ +> +else +> + ln -sf /bin/false $@ +> +endif +> + +> .PHONY: test check +> +> TEST_BINARIES=$(dir)/arg-test \ +> + $(dir)/have-compact \ +> $(dir)/hex-xcode \ +> $(dir)/random-corpus \ +> $(dir)/parse-time \ +> diff --git a/test/T020-compact.sh b/test/T020-compact.sh +> index ac174cec7111..77bb9632cb11 100755 +> --- a/test/T020-compact.sh +> +++ b/test/T020-compact.sh +> @@ -10,6 +10,17 @@ notmuch tag +tag1 \* +> notmuch tag +tag2 subject:Two +> notmuch tag -tag1 +tag3 subject:Three +> +> +if ! ${TEST_DIRECTORY}/have-compact; then +> + test_begin_subtest "Compact unsupported: error message" +> + output=$(notmuch compact --quiet 2>&1) +> + test_expect_equal "$output" "notmuch was compiled against a xapian version lacking compaction support. +> +Compaction failed: Unsupported operation" +> + +> + test_expect_code 1 "Compact unsupported: status code" "notmuch compact" +> + +> + test_done +> +fi +> + +> test_expect_success "Running compact" "notmuch compact --backup=${TEST_DIRECTORY}/xapian.old" +> +> test_begin_subtest "Compact preserves database" +> -- +> 1.9.0 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2