[PATCH 2/2] test: use sh.config for configuration
Jani Nikula
jani at nikula.org
Fri May 30 00:43:05 PDT 2014
---
test/.gitignore | 2 --
test/Makefile.local | 16 ----------------
test/T010-help-test.sh | 2 +-
test/T020-compact.sh | 2 +-
test/test-lib-common.sh | 4 ++++
5 files changed, 6 insertions(+), 20 deletions(-)
diff --git a/test/.gitignore b/test/.gitignore
index 4081cee6da18..b3b706d85188 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -1,7 +1,5 @@
arg-test
corpus.mail
-have-compact
-have-man
hex-xcode
parse-time
random-corpus
diff --git a/test/Makefile.local b/test/Makefile.local
index d622eafee786..1c85b18adc41 100644
--- a/test/Makefile.local
+++ b/test/Makefile.local
@@ -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 \
diff --git a/test/T010-help-test.sh b/test/T010-help-test.sh
index 77410bc54e66..f0ca4549dc8b 100755
--- a/test/T010-help-test.sh
+++ b/test/T010-help-test.sh
@@ -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 [ $_HAVE_MAN -eq 1 ]; then
test_expect_success 'notmuch --help tag' 'notmuch --help tag'
test_expect_success 'notmuch help tag' 'notmuch help tag'
else
diff --git a/test/T020-compact.sh b/test/T020-compact.sh
index 77bb9632cb11..19d81c5fc77d 100755
--- a/test/T020-compact.sh
+++ b/test/T020-compact.sh
@@ -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 [ $_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.
diff --git a/test/test-lib-common.sh b/test/test-lib-common.sh
index 892991e2bd03..4903038dd9ce 100644
--- a/test/test-lib-common.sh
+++ b/test/test-lib-common.sh
@@ -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 () {
--
2.0.0.rc2
More information about the notmuch
mailing list