Files
sharedinbox/scripts/run_unit_tests.sh
T

16 lines
444 B
Bash
Raw Normal View History

2026-04-16 11:48:37 +02:00
#!/usr/bin/env bash
set -euo pipefail
START=$(date +%s)
2026-04-17 10:05:31 +02:00
tmp=$(mktemp)
trap 'rm -f "$tmp"' EXIT
if fvm flutter test test/unit/ test/widget/ --coverage --no-pub --reporter expanded >"$tmp" 2>&1; then
2026-04-17 10:05:31 +02:00
# Success: show only the summary line
grep -E "^All [0-9]+ tests passed" "$tmp" || tail -1 "$tmp"
else
# Failure: show the full output so the developer sees what broke
cat "$tmp"
exit 1
fi
2026-04-16 11:48:37 +02:00
END=$(date +%s)
echo "test: $((END - START))s"