tarback/test.sh

27 lines
442 B
Bash
Raw Permalink Normal View History

2023-06-07 13:21:53 +02:00
#!/bin/sh
set -eu
early_return="${TARBACK_TEST_EARLY_RETURN:-false}"
2023-06-07 13:21:53 +02:00
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
2023-06-07 13:21:53 +02:00
fi
done
if [ $failed -ne 0 ]; then
echo "$failed tests failed"
exit 1
else
echo "all succeeded"
exit 0
fi