#!/usr/bin/env bash # Run full AetherForge Linux test suite with summary set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" cd "$ROOT" export GOROOT="${GOROOT:-/usr/local/go}" export PATH="${GOROOT}/bin:${PATH}" SUITE=( "unit:scripts/test-unit.sh" "integration:scripts/test-integration.sh" "cli:scripts/test-cli.sh" "frontend:scripts/test-frontend.sh" "e2e:scripts/e2e-test.sh" ) PASSED=() FAILED=() SKIPPED=() run_suite() { local name="$1" script="$2" echo "" echo "════════════════════════════════════════" echo " Running ${name} tests" echo "════════════════════════════════════════" if [[ ! -x "${script}" ]]; then chmod +x "${script}" fi if "${script}"; then PASSED+=("${name}") else FAILED+=("${name}") return 1 fi } CONTINUE_ON_FAIL="${CONTINUE_ON_FAIL:-0}" OVERALL=0 for entry in "${SUITE[@]}"; do name="${entry%%:*}" script="${entry#*:}" if [[ "${SKIP_E2E:-0}" == "1" && "${name}" == "e2e" ]]; then SKIPPED+=("${name}") echo "⊘ skipping e2e (SKIP_E2E=1)" continue fi if [[ "${SKIP_FRONTEND:-0}" == "1" && "${name}" == "frontend" ]]; then SKIPPED+=("${name}") echo "⊘ skipping frontend (SKIP_FRONTEND=1)" continue fi if run_suite "${name}" "${script}"; then : else OVERALL=1 [[ "${CONTINUE_ON_FAIL}" == "1" ]] || break fi done echo "" echo "════════════════════════════════════════" echo " Test summary" echo "════════════════════════════════════════" echo " Passed : ${#PASSED[@]} (${PASSED[*]:-none})" echo " Failed : ${#FAILED[@]} (${FAILED[*]:-none})" echo " Skipped: ${#SKIPPED[@]} (${SKIPPED[*]:-none})" echo "════════════════════════════════════════" if [[ "${OVERALL}" -ne 0 ]]; then echo "✗ test-all FAILED" exit 1 fi echo "✓ test-all PASSED" exit 0