Compare commits

..

No commits in common. "bc798acffa1e7fa05ac1155c5c7bdcefe70892cc" and "aa0d489e886115466ac127a1ae5ab0fc567db019" have entirely different histories.

2 changed files with 18 additions and 29 deletions

View File

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

View File

@ -15,41 +15,29 @@ done
# cd into script's directory
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null
root=$(pwd)
TMPDIR="$(mktemp --tmpdir -d isle-tests.XXXXXX)"
trap 'rm -rf $TMPDIR' EXIT
tmp="$(mktemp --tmpdir -d isle-tests.XXXXXX)"
trap 'rm -rf $tmp' EXIT
export TMPDIR
export TMPDIR="$tmp"
echo "tmp dir is $TMPDIR"
test_files=$(
find . -type f -name '*.sh' \
| sed "s|^\./||" \
| grep -v entrypoint.sh \
| sort -n\
)
echo -e '\nrunning all tests...\n'
echo -e "number of tests: $(echo "$test_files" | wc -l)\n"
for file in $test_files; do
echo "$file"
for file in $(find . -type f -name '*.sh' | grep -v entrypoint.sh | sort -n); do
echo "running test $file"
[ -z "$VERBOSE" ] && output="$TMPDIR/$file.log" || output=/dev/stdout
[ -z "$VERBOSE" ] && output="$tmp/$file.log" || output=/dev/stdout
tmp="$TMPDIR/$file.tmp"
mkdir -p "$tmp"
if ! (cd "$tmp" && TMPDIR="$tmp" $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 "$TMPDIR/$file.log"
echo "------------------------------"
fi
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 "------------------------------"
exit 1
fi
done
echo -e '\nall tests succeeded!'
echo -e '\ntests succeeded!'