run-skill-tests.sh 876 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env bash
  2. # Run every skill's behavioural test suite (skills/*/tests/run.sh).
  3. # Suites are responsible for their own OS gating (exit 0 with a skip
  4. # message on unsupported platforms). Any nonzero exit fails this runner.
  5. set -u
  6. ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
  7. cd "$ROOT" || exit 1
  8. suites=(skills/*/tests/run.sh)
  9. if [ ! -e "${suites[0]}" ]; then
  10. echo "No skill test suites found (skills/*/tests/run.sh)"
  11. exit 0
  12. fi
  13. failed=0
  14. total=0
  15. for suite in "${suites[@]}"; do
  16. total=$((total + 1))
  17. name="$(basename "$(dirname "$(dirname "$suite")")")"
  18. echo "=== $name"
  19. if bash "$suite"; then
  20. echo "--- $name: PASS"
  21. else
  22. rc=$?
  23. echo "--- $name: FAIL (exit $rc)"
  24. failed=$((failed + 1))
  25. fi
  26. echo
  27. done
  28. echo "Skill test suites: $((total - failed))/$total passed"
  29. [ "$failed" -eq 0 ] || exit 1