diff --git a/tests/entrypoint.sh b/tests/entrypoint.sh index afafe3d..e196afe 100644 --- a/tests/entrypoint.sh +++ b/tests/entrypoint.sh @@ -1,14 +1,25 @@ set -e +REGEXS=() + while [[ $# -gt 0 ]]; do case $1 in -v|--verbose) VERBOSE=1 - shift; + shift + ;; + -h|--help) + cat <"$output" 2>&1); then - echo "$file FAILED" - if [ -z "$VERBOSE" ]; then - echo "output of test is as follows" - echo "------------------------------" - cat "$TMPDIR/$file.log" - echo "------------------------------" + mkdir -p "$TMPDIR" "$XDG_RUNTIME_DIR" "$XDG_DATA_HOME" + cd "$TMPDIR" + + if ! $SHELL -e -x "$root/$file" >"$output" 2>&1; then + echo "$file FAILED" + if [ -z "$VERBOSE" ]; then + echo "output of test is as follows" + echo "------------------------------" + cat "$output" + echo "------------------------------" + fi + exit 1 fi - exit 1 - fi + ) done echo -e '\nall tests succeeded!'