1# -*- makefile-gmake -*-
2
3dir := performance-test
4
5include $(srcdir)/$(dir)/version.sh
6
7TIME_TEST_SCRIPT := ${dir}/notmuch-time-test
8MEMORY_TEST_SCRIPT := ${dir}/notmuch-memory-test
9
10CORPUS_NAME := notmuch-email-corpus-$(PERFTEST_VERSION).tar.xz
11TXZFILE := ${dir}/download/${CORPUS_NAME}
12SIGFILE := ${TXZFILE}.asc
13DEFAULT_URL :=  https://notmuchmail.org/releases/${CORPUS_NAME}
14
15perf-test: time-test memory-test
16
17time-test: setup-perf-test all
18	@echo
19	$(TIME_TEST_SCRIPT) $(OPTIONS)
20
21memory-test: setup-perf-test all
22	@echo
23	$(MEMORY_TEST_SCRIPT) $(OPTIONS)
24
25
26.PHONY: download-corpus setup-perf-test
27
28# Note that this intentionally does not depend on download-corpus.
29setup-perf-test: $(TXZFILE)
30	gpg --verify $(SIGFILE)
31
32$(TXZFILE):
33	@printf "\nPlease download ${TXZFILE} using:\n\n"
34	@printf "\t%% make download-corpus\n\n"
35	@echo or see https://notmuchmail.org/corpus for download locations
36	@echo
37	@false
38
39download-corpus:
40	wget -O ${TXZFILE} ${DEFAULT_URL}
41
42CLEAN := $(CLEAN) $(dir)/tmp.* $(dir)/log.*
43DISTCLEAN := $(DISTCLEAN) $(dir)/corpus $(dir)/notmuch.cache.*
44DATACLEAN := $(DATACLEAN) $(TXZFILE)
45