test: use sh.config for configuration
authorJani Nikula <jani@nikula.org>
Fri, 30 May 2014 07:43:05 +0000 (10:43 +0300)
committerDavid Bremner <david@tethera.net>
Sun, 13 Jul 2014 15:16:06 +0000 (12:16 -0300)
test/.gitignore
test/Makefile.local
test/T010-help-test.sh
test/T020-compact.sh
test/test-lib-common.sh

index 4081cee6da18f55ade3aae312a7366169a196b53..b3b706d851886f76b4a119363b98f4bb240f4093 100644 (file)
@@ -1,7 +1,5 @@
 arg-test
 corpus.mail
-have-compact
-have-man
 hex-xcode
 parse-time
 random-corpus
index d622eafee7865588ef4a0112225aebed8fe22bd0..1c85b18adc414ea69d5b491b3c87c97e0dd39c3e 100644 (file)
@@ -35,25 +35,9 @@ $(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
-
-$(dir)/have-man: Makefile.config
-ifeq ($(HAVE_SPHINX)$(HAVE_RST2MAN),00)
-       ln -sf /bin/false $@
-else
-       ln -sf /bin/true $@
-endif
-
 .PHONY: test check
 
 TEST_BINARIES=$(dir)/arg-test \
-             $(dir)/have-compact \
-             $(dir)/have-man \
              $(dir)/hex-xcode \
              $(dir)/random-corpus \
              $(dir)/parse-time \
index 77410bc54e66253b57fccef0013f0d4c3034acf4..caf8bdb094805f54ccbbe232a78cc26a4a504c5c 100755 (executable)
@@ -7,7 +7,7 @@ test_expect_success 'notmuch --help' 'notmuch --help'
 test_expect_success 'notmuch help' 'notmuch help'
 test_expect_success 'notmuch --version' 'notmuch --version'
 
-if ${TEST_DIRECTORY}/have-man; then
+if [ $NOTMUCH_HAVE_MAN -eq 1 ]; then
     test_expect_success 'notmuch --help tag' 'notmuch --help tag'
     test_expect_success 'notmuch help tag' 'notmuch help tag'
 else
index 77bb9632cb11ba99f0b691260157a47f119f0265..507f769857ddad7ead5912d286008f35c9af979c 100755 (executable)
@@ -10,7 +10,7 @@ notmuch tag +tag1 \*
 notmuch tag +tag2 subject:Two
 notmuch tag -tag1 +tag3 subject:Three
 
-if ! ${TEST_DIRECTORY}/have-compact; then
+if [ $NOTMUCH_HAVE_XAPIAN_COMPACT -eq 0 ]; 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.
index 892991e2bd037c9e8745bdf3cf539585cf111d21..4903038dd9ce531ea7dda467a0d0eac6f86d8bd4 100644 (file)
@@ -38,6 +38,10 @@ find_notmuch_path ()
 # test/ subdirectory and are run in 'trash directory' subdirectory.
 TEST_DIRECTORY=$(pwd)
 notmuch_path=`find_notmuch_path "$TEST_DIRECTORY"`
+
+# configure output
+. $notmuch_path/sh.config
+
 if test -n "$valgrind"
 then
        make_symlink () {