[RFC PATCH] test: merge performance-test subdirectory to tests

classic Classic list List threaded Threaded
1 message Options
Jani Nikula Jani Nikula
Reply | Threaded
Open this post in threaded view
|

[RFC PATCH] test: merge performance-test subdirectory to tests

Performance tests are just subclasses of tests, and we might as well
keep them together with the rest of the tests. This should help us
consolidate the test framework.

Rename T prefixed time tests to P prefix, giving us T for regular
tests, M for memory tests, and P for (time) performance tests.
---
 configure                                          |  2 +-
 debian/source/options                              |  2 +-
 performance-test/.gitignore                        |  4 --
 performance-test/Makefile                          |  7 ----
 performance-test/Makefile.local                    | 44 ----------------------
 test/.gitignore                                    |  3 ++
 performance-test/M00-new.sh => test/M000-new.sh    |  0
 .../M001-dump-restore.sh                           |  0
 performance-test/M02-show.sh => test/M002-show.sh  |  0
 .../M03-search.sh => test/M003-search.sh           |  0
 .../M04-reply.sh => test/M004-reply.sh             |  0
 .../M05-reindex.sh => test/M005-reindex.sh         |  0
 .../M06-insert.sh => test/M006-insert.sh           |  0
 test/Makefile.local                                | 41 +++++++++++++++++++-
 performance-test/T00-new.sh => test/P000-new.sh    |  0
 .../P001-dump-restore.sh                           |  0
 performance-test/T02-tag.sh => test/P002-tag.sh    |  0
 .../T03-reindex.sh => test/P003-reindex.sh         |  0
 performance-test/README => test/README.PERF        |  0
 {performance-test => test}/download/.gitignore     |  0
 .../download/notmuch-email-corpus-0.3.tar.xz.asc   |  0
 .../download/notmuch-email-corpus-0.4.tar.xz.asc   |  0
 {performance-test => test}/notmuch-memory-test     |  0
 {performance-test => test}/notmuch-time-test       |  2 +-
 {performance-test => test}/perf-test-lib.sh        |  2 +-
 {performance-test => test}/version.sh              |  0
 26 files changed, 47 insertions(+), 60 deletions(-)
 delete mode 100644 performance-test/.gitignore
 delete mode 100644 performance-test/Makefile
 delete mode 100644 performance-test/Makefile.local
 rename performance-test/M00-new.sh => test/M000-new.sh (100%)
 rename performance-test/M01-dump-restore.sh => test/M001-dump-restore.sh (100%)
 rename performance-test/M02-show.sh => test/M002-show.sh (100%)
 rename performance-test/M03-search.sh => test/M003-search.sh (100%)
 rename performance-test/M04-reply.sh => test/M004-reply.sh (100%)
 rename performance-test/M05-reindex.sh => test/M005-reindex.sh (100%)
 rename performance-test/M06-insert.sh => test/M006-insert.sh (100%)
 rename performance-test/T00-new.sh => test/P000-new.sh (100%)
 rename performance-test/T01-dump-restore.sh => test/P001-dump-restore.sh (100%)
 rename performance-test/T02-tag.sh => test/P002-tag.sh (100%)
 rename performance-test/T03-reindex.sh => test/P003-reindex.sh (100%)
 rename performance-test/README => test/README.PERF (100%)
 rename {performance-test => test}/download/.gitignore (100%)
 rename {performance-test => test}/download/notmuch-email-corpus-0.3.tar.xz.asc (100%)
 rename {performance-test => test}/download/notmuch-email-corpus-0.4.tar.xz.asc (100%)
 rename {performance-test => test}/notmuch-memory-test (100%)
 rename {performance-test => test}/notmuch-time-test (96%)
 rename {performance-test => test}/perf-test-lib.sh (99%)
 rename {performance-test => test}/version.sh (100%)

diff --git a/configure b/configure
index c0a550c7f9fd..45520747e85a 100755
--- a/configure
+++ b/configure
@@ -27,7 +27,7 @@ srcdir=$(dirname "$0")
 NOTMUCH_SRCDIR=$(cd "$srcdir" && pwd)
 
 subdirs="util compat lib parse-time-string completion doc emacs"
-subdirs="${subdirs} performance-test test test/test-databases"
+subdirs="${subdirs} test test/test-databases"
 subdirs="${subdirs} bindings"
 
 # For a non-srcdir configure invocation (such as ../configure), create
diff --git a/debian/source/options b/debian/source/options
index 7e95ec71c117..9bb05203278e 100644
--- a/debian/source/options
+++ b/debian/source/options
@@ -1,3 +1,3 @@
 single-debian-patch
 tar-ignore
-tar-ignore=performance-test/download/*.tar.xz
+tar-ignore=test/download/*.tar.xz
diff --git a/performance-test/.gitignore b/performance-test/.gitignore
deleted file mode 100644
index 8a5dabf5a034..000000000000
--- a/performance-test/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/tmp.*/
-/log.*/
-/corpus/
-/notmuch.cache.*/
diff --git a/performance-test/Makefile b/performance-test/Makefile
deleted file mode 100644
index de492a7c3fd5..000000000000
--- a/performance-test/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# See Makefile.local for the list of files to be compiled in this
-# directory.
-all:
- $(MAKE) -C .. all
-
-.DEFAULT:
- $(MAKE) -C .. $@
diff --git a/performance-test/Makefile.local b/performance-test/Makefile.local
deleted file mode 100644
index 9dc260e3dc51..000000000000
--- a/performance-test/Makefile.local
+++ /dev/null
@@ -1,44 +0,0 @@
-# -*- makefile -*-
-
-dir := performance-test
-
-include $(srcdir)/$(dir)/version.sh
-
-TIME_TEST_SCRIPT := ${dir}/notmuch-time-test
-MEMORY_TEST_SCRIPT := ${dir}/notmuch-memory-test
-
-CORPUS_NAME := notmuch-email-corpus-$(PERFTEST_VERSION).tar.xz
-TXZFILE := ${dir}/download/${CORPUS_NAME}
-SIGFILE := ${TXZFILE}.asc
-DEFAULT_URL :=  https://notmuchmail.org/releases/${CORPUS_NAME}
-
-perf-test: time-test memory-test
-
-time-test: setup-perf-test all
- @echo
- $(TIME_TEST_SCRIPT) $(OPTIONS)
-
-memory-test: setup-perf-test all
- @echo
- $(MEMORY_TEST_SCRIPT) $(OPTIONS)
-
-
-.PHONY: download-corpus setup-perf-test
-
-# Note that this intentionally does not depend on download-corpus.
-setup-perf-test: $(TXZFILE)
- gpg --verify $(SIGFILE)
-
-$(TXZFILE):
- @printf "\nPlease download ${TXZFILE} using:\n\n"
- @printf "\t%% make download-corpus\n\n"
- @echo or see https://notmuchmail.org/corpus for download locations
- @echo
- @false
-
-download-corpus:
- wget -O ${TXZFILE} ${DEFAULT_URL}
-
-CLEAN := $(CLEAN) $(dir)/tmp.* $(dir)/log.*
-DISTCLEAN := $(DISTCLEAN) $(dir)/corpus $(dir)/notmuch.cache.*
-DATACLEAN := $(DATACLEAN) $(TXZFILE)
diff --git a/test/.gitignore b/test/.gitignore
index 73fe7e24620f..484512678af3 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -9,3 +9,6 @@
 /test-results
 /ghost-report
 /tmp.*
+/log.*/
+/corpus/
+/notmuch.cache.*/
diff --git a/performance-test/M00-new.sh b/test/M000-new.sh
similarity index 100%
rename from performance-test/M00-new.sh
rename to test/M000-new.sh
diff --git a/performance-test/M01-dump-restore.sh b/test/M001-dump-restore.sh
similarity index 100%
rename from performance-test/M01-dump-restore.sh
rename to test/M001-dump-restore.sh
diff --git a/performance-test/M02-show.sh b/test/M002-show.sh
similarity index 100%
rename from performance-test/M02-show.sh
rename to test/M002-show.sh
diff --git a/performance-test/M03-search.sh b/test/M003-search.sh
similarity index 100%
rename from performance-test/M03-search.sh
rename to test/M003-search.sh
diff --git a/performance-test/M04-reply.sh b/test/M004-reply.sh
similarity index 100%
rename from performance-test/M04-reply.sh
rename to test/M004-reply.sh
diff --git a/performance-test/M05-reindex.sh b/test/M005-reindex.sh
similarity index 100%
rename from performance-test/M05-reindex.sh
rename to test/M005-reindex.sh
diff --git a/performance-test/M06-insert.sh b/test/M006-insert.sh
similarity index 100%
rename from performance-test/M06-insert.sh
rename to test/M006-insert.sh
diff --git a/test/Makefile.local b/test/Makefile.local
index 0df72c921654..efc80e950738 100644
--- a/test/Makefile.local
+++ b/test/Makefile.local
@@ -2,6 +2,8 @@
 
 dir := test
 
+include $(srcdir)/$(dir)/version.sh
+
 # save against changes in $(dir)
 test_src_dir := $(dir)
 extra_cflags += -I$(srcdir)
@@ -74,7 +76,44 @@ endif
 
 check: test
 
+TIME_TEST_SCRIPT := ${dir}/notmuch-time-test
+MEMORY_TEST_SCRIPT := ${dir}/notmuch-memory-test
+
+CORPUS_NAME := notmuch-email-corpus-$(PERFTEST_VERSION).tar.xz
+TXZFILE := ${dir}/download/${CORPUS_NAME}
+SIGFILE := ${TXZFILE}.asc
+DEFAULT_URL :=  https://notmuchmail.org/releases/${CORPUS_NAME}
+
+perf-test: time-test memory-test
+
+time-test: setup-perf-test all
+ @echo
+ $(TIME_TEST_SCRIPT) $(OPTIONS)
+
+memory-test: setup-perf-test all
+ @echo
+ $(MEMORY_TEST_SCRIPT) $(OPTIONS)
+
+
+.PHONY: download-corpus setup-perf-test
+
+# Note that this intentionally does not depend on download-corpus.
+setup-perf-test: $(TXZFILE)
+ gpg --verify $(SIGFILE)
+
+$(TXZFILE):
+ @printf "\nPlease download ${TXZFILE} using:\n\n"
+ @printf "\t%% make download-corpus\n\n"
+ @echo or see https://notmuchmail.org/corpus for download locations
+ @echo
+ @false
+
+download-corpus:
+ wget -O ${TXZFILE} ${DEFAULT_URL}
+
 SRCS := $(SRCS) $(test_srcs)
 CLEAN += $(TEST_BINARIES) $(addsuffix .o,$(TEST_BINARIES)) \
  $(dir)/database-test.o \
- $(dir)/corpora.mail $(dir)/test-results $(dir)/tmp.*
+ $(dir)/corpora.mail $(dir)/test-results $(dir)/tmp.* $(dir)/log.*
+DISTCLEAN := $(DISTCLEAN) $(dir)/corpus $(dir)/notmuch.cache.*
+DATACLEAN := $(DATACLEAN) $(TXZFILE)
diff --git a/performance-test/T00-new.sh b/test/P000-new.sh
similarity index 100%
rename from performance-test/T00-new.sh
rename to test/P000-new.sh
diff --git a/performance-test/T01-dump-restore.sh b/test/P001-dump-restore.sh
similarity index 100%
rename from performance-test/T01-dump-restore.sh
rename to test/P001-dump-restore.sh
diff --git a/performance-test/T02-tag.sh b/test/P002-tag.sh
similarity index 100%
rename from performance-test/T02-tag.sh
rename to test/P002-tag.sh
diff --git a/performance-test/T03-reindex.sh b/test/P003-reindex.sh
similarity index 100%
rename from performance-test/T03-reindex.sh
rename to test/P003-reindex.sh
diff --git a/performance-test/README b/test/README.PERF
similarity index 100%
rename from performance-test/README
rename to test/README.PERF
diff --git a/performance-test/download/.gitignore b/test/download/.gitignore
similarity index 100%
rename from performance-test/download/.gitignore
rename to test/download/.gitignore
diff --git a/performance-test/download/notmuch-email-corpus-0.3.tar.xz.asc b/test/download/notmuch-email-corpus-0.3.tar.xz.asc
similarity index 100%
rename from performance-test/download/notmuch-email-corpus-0.3.tar.xz.asc
rename to test/download/notmuch-email-corpus-0.3.tar.xz.asc
diff --git a/performance-test/download/notmuch-email-corpus-0.4.tar.xz.asc b/test/download/notmuch-email-corpus-0.4.tar.xz.asc
similarity index 100%
rename from performance-test/download/notmuch-email-corpus-0.4.tar.xz.asc
rename to test/download/notmuch-email-corpus-0.4.tar.xz.asc
diff --git a/performance-test/notmuch-memory-test b/test/notmuch-memory-test
similarity index 100%
rename from performance-test/notmuch-memory-test
rename to test/notmuch-memory-test
diff --git a/performance-test/notmuch-time-test b/test/notmuch-time-test
similarity index 96%
rename from performance-test/notmuch-time-test
rename to test/notmuch-time-test
index 4dd21fe1c572..82ba0aa72a62 100755
--- a/performance-test/notmuch-time-test
+++ b/test/notmuch-time-test
@@ -17,6 +17,6 @@ fi
 
 cd "$(dirname "$0")"
 
-for test in T*.sh; do
+for test in P*.sh; do
     ./"$test" "$@"
 done
diff --git a/performance-test/perf-test-lib.sh b/test/perf-test-lib.sh
similarity index 99%
rename from performance-test/perf-test-lib.sh
rename to test/perf-test-lib.sh
index c89d5aab39a0..d1e0bb0f5caa 100644
--- a/performance-test/perf-test-lib.sh
+++ b/test/perf-test-lib.sh
@@ -25,7 +25,7 @@ do
  echo "error: unknown performance test option '$1'" >&2; exit 1 ;;
  esac
 done
-. ../test/test-lib-common.sh || exit 1
+. ./test-lib-common.sh || exit 1
 
 set -e
 
diff --git a/performance-test/version.sh b/test/version.sh
similarity index 100%
rename from performance-test/version.sh
rename to test/version.sh
--
2.11.0

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch