From 48675ee095eb2aa7770bcc91d4e3bab975d2a35f Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Thu, 31 Aug 2023 21:46:56 +0200 Subject: [PATCH] Fix output of error logs in verbose testing --- tests/00-version.sh | 7 +++---- tests/entrypoint.sh | 14 ++++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/00-version.sh b/tests/00-version.sh index f8b3bf4..dde1051 100644 --- a/tests/00-version.sh +++ b/tests/00-version.sh @@ -1,4 +1,3 @@ -version="$(isle version)" -echo "$version" | grep -q 'Release:' -echo "$version" | grep -q 'Platform:' -echo "$version" | grep -q 'Build Platform:' +isle version | grep -q 'Release:' +isle version | grep -q 'Platform:' +isle version | grep -q 'Build Platform:' diff --git a/tests/entrypoint.sh b/tests/entrypoint.sh index bd84e28..8add36b 100644 --- a/tests/entrypoint.sh +++ b/tests/entrypoint.sh @@ -25,16 +25,18 @@ echo "tmp dir is $TMPDIR" echo -e '\nrunning all tests...\n' for file in $(find . -type f -name '*.sh' | grep -v entrypoint.sh | sort -n); do - echo "running test $file" + echo "$file" [ -z "$VERBOSE" ] && output="$tmp/$file.log" || output=/dev/stdout if ! $SHELL -e -x "$file" >"$output" 2>&1; then - echo "TEST FAILED" - echo "output of test is as follows" - echo "------------------------------" - cat "$tmp/$file.log" - echo "------------------------------" + echo "$file FAILED" + if [ -z "$VERBOSE" ]; then + echo "output of test is as follows" + echo "------------------------------" + cat "$tmp/$file.log" + echo "------------------------------" + fi exit 1 fi done