isle/tests/entrypoint.sh

28 lines
670 B
Bash
Raw Normal View History

2023-08-30 16:16:19 +00:00
set -e
# cd into script's directory
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null
tmp="$(mktemp --tmpdir -d isle-tests.XXXXXX)"
trap 'rm -rf $tmp' EXIT
export TMPDIR="$tmp"
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"
if ! $SHELL -e -x "$file" >"$tmp/$file.log" 2>&1; then
echo "TEST FAILED"
echo "output of test is as follows"
echo "------------------------------"
cat "$tmp/$file.log"
echo "------------------------------"
exit 1
fi
done
echo -e '\ntests succeeded!'