aboutsummaryrefslogtreecommitdiffstats
path: root/tests/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'tests/migrations')
-rw-r--r--tests/migrations/Makefile.am5
-rw-r--r--tests/migrations/all-tests.scm35
-rw-r--r--tests/migrations/run-tests.scm17
3 files changed, 46 insertions, 11 deletions
diff --git a/tests/migrations/Makefile.am b/tests/migrations/Makefile.am
index 398b15c80..d90c9c7f9 100644
--- a/tests/migrations/Makefile.am
+++ b/tests/migrations/Makefile.am
@@ -54,9 +54,10 @@ check: xcheck
.PHONY: xcheck
xcheck:
$(TESTS_ENVIRONMENT) $(abs_top_builddir)/tests/gpgscm/gpgscm \
- $(abs_srcdir)/run-tests.scm $(TESTFLAGS) $(XTESTS)
+ $(abs_srcdir)/run-tests.scm $(TESTFLAGS) $(TESTS)
-EXTRA_DIST = common.scm run-tests.scm setup.scm $(XTESTS) $(TEST_FILES)
+EXTRA_DIST = common.scm run-tests.scm setup.scm all-tests.scm \
+ $(XTESTS) $(TEST_FILES)
CLEANFILES = *.log report.xml
diff --git a/tests/migrations/all-tests.scm b/tests/migrations/all-tests.scm
new file mode 100644
index 000000000..421f69679
--- /dev/null
+++ b/tests/migrations/all-tests.scm
@@ -0,0 +1,35 @@
+;; Copyright (C) 2017 g10 Code GmbH
+;;
+;; This file is part of GnuPG.
+;;
+;; GnuPG is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; GnuPG is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+(export all-tests
+ ;; Parse the Makefile.am to find all tests.
+
+ (load (with-path "makefile.scm"))
+
+ (define (expander filename port key)
+ (parse-makefile port key))
+
+ (define (parse filename key)
+ (parse-makefile-expand filename expander key))
+
+ (map (lambda (name)
+ (test::scm #f
+ (path-join "tests" "migrations" name)
+ (in-srcdir "tests" "migrations" name)))
+ (parse-makefile-expand (in-srcdir "tests" "migrations" "Makefile.am")
+ (lambda (filename port key) (parse-makefile port key))
+ "XTESTS")))
diff --git a/tests/migrations/run-tests.scm b/tests/migrations/run-tests.scm
index 1e4bb704b..f44334c7d 100644
--- a/tests/migrations/run-tests.scm
+++ b/tests/migrations/run-tests.scm
@@ -17,12 +17,11 @@
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, see <http://www.gnu.org/licenses/>.
-(let* ((tests (filter (lambda (arg) (not (string-prefix? arg "--"))) *args*))
- (runner (if (and (member "--parallel" *args*)
- (> (length tests) 1))
- run-tests-parallel
- run-tests-sequential)))
- (runner (map (lambda (name)
- (test::scm #f
- (path-join "tests" "migrations" name)
- (in-srcdir "tests" "migrations" name))) tests)))
+(define tests (filter (lambda (arg) (not (string-prefix? arg "--"))) *args*))
+
+(run-tests (if (null? tests)
+ (load-tests "tests" "migrations")
+ (map (lambda (name)
+ (test::scm #f
+ (path-join "tests" "migrations" name)
+ (in-srcdir "tests" "migrations" name))) tests)))