commit 4acb00a665a5bda7b9d7ee156ebf21396afca12a Author: Jacob Welsh AuthorDate: Mon Nov 21 21:23:25 2022 +0000 Commit: Jacob Welsh CommitDate: Mon Nov 21 21:23:25 2022 +0000 Type: new structure offload main test suite loop from Makefile to proper script, to implement aggregate failure reporting diff --git a/src/Makefile b/src/Makefile index c96e71b465..0776828456 100644 --- a/src/Makefile +++ b/src/Makefile @@ -224,6 +224,7 @@ TEST_PROGS = \ lib-mail/test-rfc822-parser \ lib-master/test-event-stats \ lib-master/test-master-service-settings-cache \ + lib-program-client/test-program-client-local \ lib-program-client/test-program-client-net \ lib-program-client/test-program-client-unix \ lib-sasl/test-sasl-client \ @@ -236,6 +237,7 @@ TEST_PROGS = \ lib-smtp/test-smtp-payload \ lib-smtp/test-smtp-reply \ lib-smtp/test-smtp-server-errors \ + lib-smtp/test-smtp-submit \ lib-smtp/test-smtp-syntax \ lib-storage/test-mail \ lib-storage/test-mail-search-args-imap \ @@ -261,8 +263,6 @@ OTHER_PROGS = \ lib-dict/test-dict-client \ lib-http/test-http-server \ lib-http/test-http-client \ - lib-program-client/test-program-client-local \ - lib-smtp/test-smtp-submit \ plugins/fts-squat/squat-test \ util/test-fs \ @@ -2005,9 +2005,7 @@ libdovecot.a: $(LIBDOVECOT_OBJS) $(AR) -rcs $@ $^ check: all - for bin in $(TEST_PROGS); do $(RUN_TEST) ./$$bin || exit 1; done - env NOCHILDREN=yes $(RUN_TEST) ./lib-program-client/test-program-client-local - env NOCHILDREN=yes $(RUN_TEST) ./lib-smtp/test-smtp-submit + sh run-tests.sh $(TEST_PROGS) install: all install -d $(DESTDIR)$(bindir) diff --git a/src/run-tests.sh b/src/run-tests.sh new file mode 100644 index 0000000000..b08ec36e48 --- /dev/null +++ b/src/run-tests.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +total=0 +fail=0 +while [ $# -gt 0 ]; do + if [ $1 = "lib-program-client/test-program-client-local" -o $1 = "lib-smtp/test-smtp-submit" ]; then + # weird special cases carried from prior Makefile.am "check" recipes + cmd="env NOCHILDREN=yes ./$1" + else + cmd="./$1" + fi + shift + echo + echo "Running: $cmd" + $cmd || let fail++ + let total++ +done + +echo "Total: $fail / $total test programs failed" +[ $fail -eq 0 ]