Fix output of error logs in verbose testing

This commit is contained in:
Brian Picciano 2023-08-31 21:46:56 +02:00
parent aa0d489e88
commit 48675ee095
2 changed files with 11 additions and 10 deletions

View File

@ -1,4 +1,3 @@
version="$(isle version)" isle version | grep -q 'Release:'
echo "$version" | grep -q 'Release:' isle version | grep -q 'Platform:'
echo "$version" | grep -q 'Platform:' isle version | grep -q 'Build Platform:'
echo "$version" | grep -q 'Build Platform:'

View File

@ -25,16 +25,18 @@ echo "tmp dir is $TMPDIR"
echo -e '\nrunning all tests...\n' echo -e '\nrunning all tests...\n'
for file in $(find . -type f -name '*.sh' | grep -v entrypoint.sh | sort -n); do 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 [ -z "$VERBOSE" ] && output="$tmp/$file.log" || output=/dev/stdout
if ! $SHELL -e -x "$file" >"$output" 2>&1; then if ! $SHELL -e -x "$file" >"$output" 2>&1; then
echo "TEST FAILED" echo "$file FAILED"
echo "output of test is as follows" if [ -z "$VERBOSE" ]; then
echo "------------------------------" echo "output of test is as follows"
cat "$tmp/$file.log" echo "------------------------------"
echo "------------------------------" cat "$tmp/$file.log"
echo "------------------------------"
fi
exit 1 exit 1
fi fi
done done