aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2021-02-21 12:01:28 +0100
committerGuilhem Moulin <guilhem@fripost.org>2021-02-21 12:17:02 +0100
commit543578b20187836a83d84c7cd669cb2448e3a3d7 (patch)
tree6afb7b54fd6091bbe949bb5b7e20bc7547bcf11b
parent626c0418b3d8c3747a7be8e2620d7c85a8c2c613 (diff)
test suite: Indicate which tests have passed.
-rwxr-xr-xtest30
1 files changed, 23 insertions, 7 deletions
diff --git a/test b/test
index 2be9303..c9aaef8 100755
--- a/test
+++ b/test
@@ -222,15 +222,31 @@ run() {
PATH="/usr/sbin:/usr/bin:/sbin:/bin" \
DOMAINNAME="$DOMAINNAME" \
sh -ue "$testdir/run" || return $?
-
- # clean up
- schroot -c "$CHROOT" -e
- CHROOT=""
}
+RV=0
+declare -a PASSED=() FAILED=()
for t in "${TESTS[@]}"; do
- if ! run "$t"; then
- echo "FAILED: $t" >&2
- exit 1
+ run "$t" && rv=0 || rv=$?
+ if [ -n "$CHROOT" ]; then
+ # clean up
+ schroot -c "$CHROOT" -e
+ CHROOT=""
+ fi
+ if [ $rv -eq 0 ]; then
+ PASSED+=( "$t" )
+ else
+ FAILED+=( "$t" )
+ RV=$rv
+ break # stop at the first failure
fi
done
+
+echo >&2
+echo "================================================================================" >&2
+
+echo "PASSED: ${PASSED[*]:-"(none)"}" >&2
+if [ ${#FAILED[@]} -gt 0 ]; then
+ echo "FAILED: ${FAILED[*]}" >&2
+fi
+exit $RV