From 543578b20187836a83d84c7cd669cb2448e3a3d7 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 21 Feb 2021 12:01:28 +0100 Subject: test suite: Indicate which tests have passed. --- test | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'test') 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 -- cgit v1.2.3