mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 11:03:59 +00:00
39 lines
905 B
Bash
39 lines
905 B
Bash
#!/usr/bin/env bash
|
|
# knoe/tests/etc/run_all.sh
|
|
# Runner for all script unit tests in etc/
|
|
|
|
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
TEST_DIR="$SCRIPT_DIR"
|
|
PASSED=0
|
|
FAILED=0
|
|
FAILED_TESTS=()
|
|
|
|
echo "Running etc/ script unit tests..."
|
|
echo "--------------------------------"
|
|
|
|
for test_script in "$TEST_DIR"/test_*.sh; do
|
|
if [[ -f "$test_script" ]]; then
|
|
echo -n "Running $(basename "$test_script")... "
|
|
if bash "$test_script" > /dev/null 2>&1; then
|
|
echo "PASSED"
|
|
((PASSED++))
|
|
else
|
|
echo "FAILED"
|
|
((FAILED++))
|
|
FAILED_TESTS+=("$(basename "$test_script")")
|
|
fi
|
|
fi
|
|
done
|
|
|
|
echo "--------------------------------"
|
|
echo "Tests completed: $((PASSED + FAILED))"
|
|
echo "Passed: $PASSED"
|
|
echo "Failed: $FAILED"
|
|
|
|
if [[ $FAILED -gt 0 ]]; then
|
|
echo "Failed tests: ${FAILED_TESTS[*]}"
|
|
exit 1
|
|
fi
|
|
|
|
exit 0
|