test: use sh.config for configuration

This commit is contained in:
Jani Nikula 2014-05-30 10:43:05 +03:00 committed by David Bremner
parent 57540a1952
commit c2d8236b56
5 changed files with 6 additions and 20 deletions

2
test/.gitignore vendored
View file

@ -1,7 +1,5 @@
arg-test
corpus.mail
have-compact
have-man
hex-xcode
parse-time
random-corpus

View 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 \

View file

@ -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

View file

@ -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.

View 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 () {