tarback/test.sh

26 lines
442 B
Bash
Executable file

#!/bin/sh
set -eu
early_return="${TARBACK_TEST_EARLY_RETURN:-false}"
failed=0
for f in ./tests/test-*.sh; do
printf '%s' "Running test $f ... "
if "$f"; then
echo "succeeded"
else
failed=$((failed+1))
echo "failed"
if "$early_return"; then
break
fi
fi
done
if [ $failed -ne 0 ]; then
echo "$failed tests failed"
exit 1
else
echo "all succeeded"
exit 0
fi