Compare commits
2 Commits
aa0d489e88
...
bc798acffa
Author | SHA1 | Date | |
---|---|---|---|
|
bc798acffa | ||
|
48675ee095 |
@ -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:'
|
|
||||||
|
@ -15,29 +15,41 @@ done
|
|||||||
|
|
||||||
# cd into script's directory
|
# cd into script's directory
|
||||||
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null
|
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null
|
||||||
|
root=$(pwd)
|
||||||
|
|
||||||
tmp="$(mktemp --tmpdir -d isle-tests.XXXXXX)"
|
TMPDIR="$(mktemp --tmpdir -d isle-tests.XXXXXX)"
|
||||||
trap 'rm -rf $tmp' EXIT
|
trap 'rm -rf $TMPDIR' EXIT
|
||||||
|
|
||||||
export TMPDIR="$tmp"
|
export TMPDIR
|
||||||
echo "tmp dir is $TMPDIR"
|
echo "tmp dir is $TMPDIR"
|
||||||
|
|
||||||
echo -e '\nrunning all tests...\n'
|
test_files=$(
|
||||||
|
find . -type f -name '*.sh' \
|
||||||
|
| sed "s|^\./||" \
|
||||||
|
| grep -v entrypoint.sh \
|
||||||
|
| sort -n\
|
||||||
|
)
|
||||||
|
|
||||||
for file in $(find . -type f -name '*.sh' | grep -v entrypoint.sh | sort -n); do
|
echo -e "number of tests: $(echo "$test_files" | wc -l)\n"
|
||||||
echo "running test $file"
|
for file in $test_files; do
|
||||||
|
echo "$file"
|
||||||
|
|
||||||
[ -z "$VERBOSE" ] && output="$tmp/$file.log" || output=/dev/stdout
|
[ -z "$VERBOSE" ] && output="$TMPDIR/$file.log" || output=/dev/stdout
|
||||||
|
|
||||||
if ! $SHELL -e -x "$file" >"$output" 2>&1; then
|
tmp="$TMPDIR/$file.tmp"
|
||||||
echo "TEST FAILED"
|
mkdir -p "$tmp"
|
||||||
echo "output of test is as follows"
|
|
||||||
echo "------------------------------"
|
if ! (cd "$tmp" && TMPDIR="$tmp" $SHELL -e -x "$root/$file" >"$output" 2>&1); then
|
||||||
cat "$tmp/$file.log"
|
echo "$file FAILED"
|
||||||
echo "------------------------------"
|
if [ -z "$VERBOSE" ]; then
|
||||||
|
echo "output of test is as follows"
|
||||||
|
echo "------------------------------"
|
||||||
|
cat "$TMPDIR/$file.log"
|
||||||
|
echo "------------------------------"
|
||||||
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -e '\ntests succeeded!'
|
echo -e '\nall tests succeeded!'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user