docs: add architecture and full audit; fill project templates (.gitignore, scripts/test.sh) per audit findings
Some checks failed
ci / test (push) Has been cancelled
Some checks failed
ci / test (push) Has been cancelled
This commit is contained in:
32
templates/project/_shared/scripts/test.sh
Normal file
32
templates/project/_shared/scripts/test.sh
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
|
||||
if command -v bats >/dev/null 2>&1; then
|
||||
exec bats "$ROOT_DIR/tests"
|
||||
fi
|
||||
|
||||
echo "[info] bats not found; using internal test runner" >&2
|
||||
|
||||
failures=0
|
||||
total=0
|
||||
|
||||
for t in "$ROOT_DIR"/tests/*.sh; do
|
||||
[ -f "$t" ] || continue
|
||||
total=$((total+1))
|
||||
echo "[run] $t"
|
||||
if bash "$t"; then
|
||||
echo "[ok] $t"
|
||||
else
|
||||
echo "[fail] $t" >&2
|
||||
failures=$((failures+1))
|
||||
fi
|
||||
done
|
||||
|
||||
echo "[summary] total=$total failures=$failures"
|
||||
if [ "$failures" -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
|
Reference in New Issue
Block a user