From d2d25d3621f551725d4e300a15e7bb883fabfc69 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Fri, 1 Sep 2023 16:18:23 +0200 Subject: [PATCH] Set XDG variables on a per-test basis --- tests/entrypoint.sh | 49 ++++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 14 deletions(-) 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!'