2010-09-17 21:10:54 +02:00
|
|
|
# -*- makefile -*-
|
|
|
|
|
|
|
|
dir := test
|
|
|
|
|
2014-03-08 15:00:39 +01:00
|
|
|
# save against changes in $(dir)
|
|
|
|
test_src_dir := $(dir)
|
2014-03-20 01:48:04 +01:00
|
|
|
extra_cflags += -I$(srcdir)
|
2011-12-07 19:37:13 +01:00
|
|
|
|
2011-05-18 22:15:46 +02:00
|
|
|
smtp_dummy_srcs = \
|
|
|
|
$(notmuch_compat_srcs) \
|
|
|
|
$(dir)/smtp-dummy.c
|
|
|
|
|
|
|
|
smtp_dummy_modules = $(smtp_dummy_srcs:.c=.o)
|
|
|
|
|
2011-12-07 19:37:13 +01:00
|
|
|
$(dir)/arg-test: $(dir)/arg-test.o command-line-arguments.o util/libutil.a
|
2014-10-20 17:03:21 +02:00
|
|
|
$(call quiet,CC) $^ -o $@ $(LDFLAGS)
|
2011-12-07 19:37:13 +01:00
|
|
|
|
2012-06-15 00:08:37 +02:00
|
|
|
$(dir)/hex-xcode: $(dir)/hex-xcode.o command-line-arguments.o util/libutil.a
|
2014-10-20 17:03:21 +02:00
|
|
|
$(call quiet,CC) $^ -o $@ $(LDFLAGS) $(TALLOC_LDFLAGS)
|
2012-06-15 00:08:37 +02:00
|
|
|
|
2012-08-05 20:13:12 +02:00
|
|
|
random_corpus_deps = $(dir)/random-corpus.o $(dir)/database-test.o \
|
2016-03-22 11:54:52 +01:00
|
|
|
notmuch-config.o status.o command-line-arguments.o \
|
2012-08-05 20:13:12 +02:00
|
|
|
lib/libnotmuch.a util/libutil.a \
|
|
|
|
parse-time-string/libparse-time-string.a
|
|
|
|
|
|
|
|
$(dir)/random-corpus: $(random_corpus_deps)
|
2014-10-20 17:03:21 +02:00
|
|
|
$(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(CONFIGURE_LDFLAGS)
|
2012-08-05 20:13:12 +02:00
|
|
|
|
2011-05-18 22:15:46 +02:00
|
|
|
$(dir)/smtp-dummy: $(smtp_dummy_modules)
|
2014-10-20 17:03:21 +02:00
|
|
|
$(call quiet,CC) $^ -o $@ $(LDFLAGS)
|
2010-10-27 19:42:46 +02:00
|
|
|
|
2013-08-13 21:52:17 +02:00
|
|
|
$(dir)/symbol-test: $(dir)/symbol-test.o lib/$(LINKER_NAME)
|
2014-10-20 17:03:21 +02:00
|
|
|
$(call quiet,CXX) $^ -o $@ $(LDFLAGS) -Llib -lnotmuch $(XAPIAN_LDFLAGS)
|
2011-11-26 22:14:20 +01:00
|
|
|
|
2012-10-30 21:32:34 +01:00
|
|
|
$(dir)/parse-time: $(dir)/parse-time.o parse-time-string/parse-time-string.o
|
2014-10-20 17:03:21 +02:00
|
|
|
$(call quiet,CC) $^ -o $@ $(LDFLAGS)
|
2012-10-30 21:32:34 +01:00
|
|
|
|
2014-08-25 19:26:01 +02:00
|
|
|
$(dir)/make-db-version: $(dir)/make-db-version.o
|
2014-10-20 17:03:21 +02:00
|
|
|
$(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)
|
2014-08-25 19:26:01 +02:00
|
|
|
|
2016-04-09 03:54:46 +02:00
|
|
|
$(dir)/ghost-report: $(dir)/ghost-report.o
|
|
|
|
$(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)
|
|
|
|
|
2010-11-06 01:50:12 +01:00
|
|
|
.PHONY: test check
|
2011-12-03 23:05:08 +01:00
|
|
|
|
2014-08-01 04:09:51 +02:00
|
|
|
test_main_srcs=$(dir)/arg-test.c \
|
|
|
|
$(dir)/hex-xcode.c \
|
|
|
|
$(dir)/random-corpus.c \
|
|
|
|
$(dir)/parse-time.c \
|
|
|
|
$(dir)/smtp-dummy.c \
|
|
|
|
$(dir)/symbol-test.cc \
|
2014-08-25 19:26:01 +02:00
|
|
|
$(dir)/make-db-version.cc \
|
2016-04-09 03:54:46 +02:00
|
|
|
$(dir)/ghost-report.cc
|
2014-08-01 04:09:51 +02:00
|
|
|
|
|
|
|
test_srcs=$(test_main_srcs) $(dir)/database-test.c
|
|
|
|
|
|
|
|
TEST_BINARIES := $(test_main_srcs:.c=)
|
|
|
|
TEST_BINARIES := $(TEST_BINARIES:.cc=)
|
2012-06-15 00:08:37 +02:00
|
|
|
|
|
|
|
test-binaries: $(TEST_BINARIES)
|
2011-12-03 23:05:08 +01:00
|
|
|
|
|
|
|
test: all test-binaries
|
2015-09-11 22:44:11 +02:00
|
|
|
ifeq ($V,)
|
2016-01-29 12:53:12 +01:00
|
|
|
@echo 'Use "$(MAKE) V=1" to print test headings and PASSing results.'
|
2015-09-11 22:44:11 +02:00
|
|
|
@env NOTMUCH_TEST_QUIET=1 ${test_src_dir}/notmuch-test $(OPTIONS)
|
|
|
|
else
|
|
|
|
# The user has explicitly enabled quiet execution.
|
|
|
|
ifeq ($V,0)
|
|
|
|
@env NOTMUCH_TEST_QUIET=1 ${test_src_dir}/notmuch-test $(OPTIONS)
|
|
|
|
else
|
2014-03-08 15:00:39 +01:00
|
|
|
@${test_src_dir}/notmuch-test $(OPTIONS)
|
2015-09-11 22:44:11 +02:00
|
|
|
endif
|
|
|
|
endif
|
2010-10-27 19:42:46 +02:00
|
|
|
|
2010-11-06 01:50:12 +01:00
|
|
|
check: test
|
|
|
|
|
2014-08-01 04:09:51 +02:00
|
|
|
SRCS := $(SRCS) $(test_srcs)
|
2014-02-25 20:18:59 +01:00
|
|
|
CLEAN += $(TEST_BINARIES) $(addsuffix .o,$(TEST_BINARIES)) \
|
2012-08-05 20:13:11 +02:00
|
|
|
$(dir)/database-test.o \
|
2016-11-27 13:04:38 +01:00
|
|
|
$(dir)/corpora.mail $(dir)/test-results $(dir)/tmp.*
|