diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2018-03-18 11:23:10 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2018-03-18 12:34:08 -0400 |
commit | c6d88ba2bd43db9a3bcc19f27bf803921835c549 (patch) | |
tree | a042ae5192a382e4e84c90a38d26ea33ae755553 /tests.sh | |
parent | c3b43840431b059266df6c8fcc051598e38457ef (diff) | |
download | bfs-c6d88ba2bd43db9a3bcc19f27bf803921835c549.tar.xz |
tests: Add a --noclean option to preserve the test directory
Useful for debugging testsuite failures.
Diffstat (limited to 'tests.sh')
-rwxr-xr-x | tests.sh | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -24,10 +24,15 @@ export TZ=UTC # The temporary directory that will hold our test data TMP="$(mktemp -d "${TMPDIR:-/tmp}"/bfs.XXXXXXXXXX)" -chown "$(id -u)":"$(id -g)" "$TMP" +chown "$(id -u):$(id -g)" "$TMP" # Clean up temporary directories on exit +CLEAN=yes function cleanup() { + if [ ! "$CLEAN" ]; then + return + fi + rm -rf "$TMP" } trap cleanup EXIT @@ -440,6 +445,9 @@ for arg; do GNU=yes ALL=yes ;; + --noclean) + CLEAN= + ;; --update) UPDATE=yes ;; @@ -457,7 +465,11 @@ for arg; do esac done -if [ -z "$EXPLICIT" ]; then +if [ ! "$CLEAN" ]; then + echo "Test files saved to $TMP" +fi + +if [ ! "$EXPLICIT" ]; then enable_tests "${posix_tests[@]}" [ "$BSD" ] && enable_tests "${bsd_tests[@]}" [ "$GNU" ] && enable_tests "${gnu_tests[@]}" |