diff --git a/test/all b/test/all index 693a8c4e..7dae67c5 100755 --- a/test/all +++ b/test/all @@ -8,7 +8,16 @@ tests=( "$ROOT/test/shell" ) +# Run every suite even when an earlier one fails, so a single failure can't +# hide whole suites behind it. +failed=() for test in "${tests[@]}"; do printf '==> %s\n' "${test#$ROOT/}" - "$test" + "$test" || failed+=("${test#$ROOT/}") done + +if (( ${#failed[@]} > 0 )); then + printf '\n%d of %d suites failed:\n' "${#failed[@]}" "${#tests[@]}" >&2 + printf ' %s\n' "${failed[@]}" >&2 + exit 1 +fi diff --git a/test/shell b/test/shell index 215b98aa..c7d7e5fc 100755 --- a/test/shell +++ b/test/shell @@ -18,7 +18,19 @@ if (( ${#tests[@]} == 0 )); then exit 1 fi +# Keep going after a failing file. A test file exits at its first failed +# assertion, so aborting the run there too would hide every file after it -- +# one packaging failure was masking 114 of 134 files. +failed=() for test in "${tests[@]}"; do printf '==> %s\n' "${test#$ROOT/}" - bash "$test" + bash "$test" || failed+=("${test#$ROOT/}") done + +if (( ${#failed[@]} > 0 )); then + printf '\n%d of %d test files failed:\n' "${#failed[@]}" "${#tests[@]}" >&2 + printf ' %s\n' "${failed[@]}" >&2 + exit 1 +fi + +printf '\nAll %d test files passed.\n' "${#tests[@]}"