]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Makefile.test.include: Use "make check" tests in parallel
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 5 Nov 2025 10:54:33 +0000 (12:54 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 10 Nov 2025 12:12:12 +0000 (12:12 +0000)
Makefile.test.include
build-aux/run-test.sh.in

index 2021a315baa2cb30190e13da023cf4b56a2d6313..8ffa206cf38da864c1a4866bb3dd1e0767376f7e 100644 (file)
@@ -1,6 +1,5 @@
+AUTOMAKE_OPTIONS = parallel-tests
+check_PROGRAMS = $(test_programs)
 noinst_PROGRAMS = $(test_programs)
-
-check-local:
-       for bin in $(test_programs); do \
-         if ! $(RUN_TEST) NOCHILDREN_TESTS="$(NOCHILDREN_TESTS)" ./$$bin; then exit 1; fi; \
-       done
+TESTS = $(test_programs)
+TESTS_ENVIRONMENT = $(RUN_TEST) NOCHILDREN_TESTS="$(NOCHILDREN_TESTS)"
index f2297891dc89f4bb74fdf952f7945283dcc44bb2..61f6853f39ab486da81905f178bffa481ba8fb91 100644 (file)
@@ -5,7 +5,33 @@
 set -eu
 
 function get_test_name() {
-  basename "$1"
+  while [ $# -gt 0 ]; do
+    case "$1" in
+      --test-name)
+       echo "$2"
+       return
+       ;;
+      *)
+       shift
+       ;;
+    esac
+  done
+  echo "Missing --test-name parameter" >&2
+  exit 1
+}
+
+function cat_log_file() {
+  while [ $# -gt 0 ]; do
+    case "$1" in
+      --log-file)
+       cat $2
+       break
+       ;;
+      *)
+       shift
+       ;;
+    esac
+  done
 }
 
 top_srcdir="@abs_top_srcdir@"
@@ -63,4 +89,5 @@ if test $ret != 0; then
   echo "Failed to run: $@" >&2
 fi
 
+cat_log_file "$@"
 exit $ret