diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-05-13 16:08:48 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-05-13 16:08:48 -0400 |
commit | b180a0e78bd81376491ea2a9ac6349e25f7e52d4 (patch) | |
tree | a3a04026dbee30932eb7f2a96e6adb815dfa742a /tests.sh | |
parent | 28608a595ef572de15ae89e8f64e110aed67101c (diff) | |
download | bfs-b180a0e78bd81376491ea2a9ac6349e25f7e52d4.tar.xz |
tests: New --stop flag to stop after the first failure
Diffstat (limited to 'tests.sh')
-rwxr-xr-x | tests.sh | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -82,7 +82,7 @@ function usage() { local pad=$(printf "%*s" ${#0} "") cat <<EOF Usage: ${GRN}$0${RST} [${BLU}--bfs${RST}=${MAG}path/to/bfs${RST}] [${BLU}--posix${RST}] [${BLU}--bsd${RST}] [${BLU}--gnu${RST}] [${BLU}--all${RST}] [${BLU}--sudo${RST}] - $pad [${BLU}--noclean${RST}] [${BLU}--update${RST}] [${BLU}--verbose${RST}[=${BLD}LEVEL${RST}]] [${BLU}--help${RST}] + $pad [${BLU}--stop${RST}] [${BLU}--noclean${RST}] [${BLU}--update${RST}] [${BLU}--verbose${RST}[=${BLD}LEVEL${RST}]] [${BLU}--help${RST}] $pad [${BLD}test_*${RST} [${BLD}test_*${RST} ...]] ${BLU}--bfs${RST}=${MAG}path/to/bfs${RST} @@ -94,6 +94,9 @@ Usage: ${GRN}$0${RST} [${BLU}--bfs${RST}=${MAG}path/to/bfs${RST}] [${BLU}--posix ${BLU}--sudo${RST} Run tests that require root + ${BLU}--stop${RST} + Stop when the first error occurs + ${BLU}--noclean${RST} Keep the test directories around after the run @@ -125,6 +128,7 @@ BSD= GNU= ALL= SUDO= +STOP= CLEAN=yes UPDATE= VERBOSE_COMMANDS= @@ -164,6 +168,9 @@ for arg; do --sudo) SUDO=yes ;; + --stop) + STOP=yes + ;; --noclean) CLEAN= ;; @@ -3412,6 +3419,7 @@ for test in "${enabled_tests[@]}"; do ((++failed)) [ "$VERBOSE_ERRORS" ] || cat "$TMP/stderr" >&2 printf "${BOL}${RED}%s failed!${RST}\n" "$test" + [ "$STOP" ] && break fi done |