Add --keep-tmp flag to test script

This commit is contained in:
Brian Picciano 2023-09-01 17:19:48 +02:00
parent 0b486d5d27
commit ae70278a9f

View File

@ -4,19 +4,24 @@ REGEXS=()
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
-v|--verbose)
VERBOSE=1
shift
;;
-h|--help) -h|--help)
cat <<EOF cat <<EOF
USAGE: [flags] [test regexs...] USAGE: [flags] [test regexs...]
FLAGS FLAGS
--keep-tmp
--verbose (-v) --verbose (-v)
--help (-h) --help (-h)
EOF EOF
exit 1 exit 1
;; ;;
-v|--verbose)
VERBOSE=1
shift
;;
--keep-tmp)
KEEP_TMP=1
shift
;;
*) *)
REGEXS+=("$1") REGEXS+=("$1")
shift shift
@ -29,7 +34,7 @@ cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null
root=$(pwd) root=$(pwd)
TMPDIR="$(mktemp --tmpdir -d isle-tests.XXXXXX)" TMPDIR="$(mktemp --tmpdir -d isle-tests.XXXXXX)"
trap 'rm -rf $TMPDIR' EXIT if [ -z "$KEEP_TMP" ]; then trap 'rm -rf $TMPDIR' EXIT; fi
export TMPDIR export TMPDIR
echo "tmp dir is $TMPDIR" echo "tmp dir is $TMPDIR"