]> git.cworth.org Git - notmuch/blob - test/Makefile.local
NEWS: The minimum supported major version of Emacs is now 24.
[notmuch] / test / Makefile.local
1 # -*- makefile -*-
2
3 dir := test
4
5 # save against changes in $(dir)
6 test_src_dir := $(dir)
7 extra_cflags += -I$(srcdir)
8
9 smtp_dummy_srcs =               \
10         $(notmuch_compat_srcs)  \
11         $(dir)/smtp-dummy.c
12
13 smtp_dummy_modules = $(smtp_dummy_srcs:.c=.o)
14
15 $(dir)/arg-test: $(dir)/arg-test.o command-line-arguments.o util/libnotmuch_util.a
16         $(call quiet,CC) $^ -o $@ $(LDFLAGS)
17
18 $(dir)/message-id-parse: $(dir)/message-id-parse.o lib/libnotmuch.a util/libnotmuch_util.a
19         $(call quiet,CC) $^ -o $@ $(LDFLAGS) $(TALLOC_LDFLAGS)
20
21 $(dir)/hex-xcode: $(dir)/hex-xcode.o command-line-arguments.o util/libnotmuch_util.a
22         $(call quiet,CC) $^ -o $@ $(LDFLAGS) $(TALLOC_LDFLAGS)
23
24 random_corpus_deps =  $(dir)/random-corpus.o  $(dir)/database-test.o \
25                         notmuch-config.o status.o command-line-arguments.o \
26                         lib/libnotmuch.a util/libnotmuch_util.a \
27                         parse-time-string/libparse-time-string.a
28
29 $(dir)/random-corpus: $(random_corpus_deps)
30         $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(CONFIGURE_LDFLAGS)
31
32 $(dir)/smtp-dummy: $(smtp_dummy_modules)
33         $(call quiet,CC) $^ -o $@ $(LDFLAGS)
34
35 $(dir)/symbol-test: $(dir)/symbol-test.o lib/$(LINKER_NAME)
36         $(call quiet,CXX) $^ -o $@ $(LDFLAGS) -Llib -lnotmuch $(XAPIAN_LDFLAGS)
37
38 $(dir)/parse-time: $(dir)/parse-time.o parse-time-string/parse-time-string.o
39         $(call quiet,CC) $^ -o $@ $(LDFLAGS)
40
41 $(dir)/make-db-version: $(dir)/make-db-version.o
42         $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)
43
44 $(dir)/ghost-report: $(dir)/ghost-report.o
45         $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)
46
47 .PHONY: test check
48
49 test_main_srcs=$(dir)/arg-test.c \
50               $(dir)/hex-xcode.c \
51               $(dir)/random-corpus.c \
52               $(dir)/parse-time.c \
53               $(dir)/smtp-dummy.c \
54               $(dir)/symbol-test.cc \
55               $(dir)/make-db-version.cc \
56               $(dir)/ghost-report.cc \
57               $(dir)/message-id-parse.c
58
59 test_srcs=$(test_main_srcs) $(dir)/database-test.c
60
61 TEST_BINARIES := $(test_main_srcs:.c=)
62 TEST_BINARIES := $(TEST_BINARIES:.cc=)
63
64 test-binaries: $(TEST_BINARIES)
65
66 test:   all test-binaries
67 ifeq ($V,)
68         @echo 'Use "$(MAKE) V=1" to see the details for passing and known broken tests.'
69         @env NOTMUCH_TEST_QUIET=1 $(NOTMUCH_SRCDIR)/$(test_src_dir)/notmuch-test $(OPTIONS)
70 else
71 # The user has explicitly enabled quiet execution.
72 ifeq ($V,0)
73         @env NOTMUCH_TEST_QUIET=1 $(NOTMUCH_SRCDIR)/$(test_src_dir)/notmuch-test $(OPTIONS)
74 else
75         @$(NOTMUCH_SRCDIR)/$(test_src_dir)/notmuch-test $(OPTIONS)
76 endif
77 endif
78
79 check: test
80
81 SRCS := $(SRCS) $(test_srcs)
82 CLEAN += $(TEST_BINARIES) $(addsuffix .o,$(TEST_BINARIES)) \
83          $(dir)/database-test.o \
84          $(dir)/test-results $(dir)/tmp.*