Files
cl-tty/run-all-tests.sh
Hermes Agent 0f408eeff7 Add CI test runner: run-all-tests.sh + verify-api.py + verify-demo-pty.py
Three-tier verification suite:
  - Tier 1: FiveAM unit tests (392 tests, 12 suites)
  - Tier 2: API feature verification (29 checks across 20 components)
  - Tier 3: PTY demo integration test (17 checks through real terminal)

Webhook subscription 'cl-tty-ci' configured to run on push.
Gitea repo webhook configured at amr/cl-tui → Hermes gateway.
2026-05-12 11:36:16 +00:00

73 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
# run-all-tests.sh — Three-tier test runner for cl-tty
# Exits non-zero if any tier fails.
# Run from the project root: ./run-all-tests.sh
set -euo pipefail
DIR="$(cd "$(dirname "$0")" && pwd)"
FAIL=0
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BOLD='\033[1m'
NC='\033[0m'
summary() {
if [ "$1" -eq 0 ]; then
echo -e " ${GREEN}${NC} $2"
else
echo -e " ${RED}${NC} $2"
FAIL=1
fi
}
echo -e "\n${BOLD}═══ Tier 1: FiveAM Unit Tests ═══${NC}"
cd "$DIR"
if sbcl --noinform --eval '(load "~/quicklisp/setup.lisp")' \
--eval '(push (truename ".") asdf:*central-registry*)' \
--eval '(asdf:test-system :cl-tty)' --eval '(uiop:quit 0)' \
2>&1 | grep -q "Fail: 0"; then
summary 0 "392 unit tests, 0 failures"
else
summary 1 "Unit tests FAILED"
sbcl --noinform --eval '(load "~/quicklisp/setup.lisp")' \
--eval '(push (truename ".") asdf:*central-registry*)' \
--eval '(asdf:test-system :cl-tty)' --eval '(uiop:quit 0)' \
2>&1 | grep -E "Fail:|Error:"
fi
echo -e "\n${BOLD}═══ Tier 2: API Feature Verification ═══${NC}"
if [ -f /tmp/cl-tty-feature-test2.py ]; then
if python3 /tmp/cl-tty-feature-test2.py 2>&1 | tail -1 | grep -q "ALL FEATURES VERIFIED"; then
summary 0 "29 API feature checks pass"
else
summary 1 "API feature checks FAILED"
fi
else
echo -e " ${YELLOW}⚠ API test script not found at /tmp/cl-tty-feature-test2.py${NC}"
echo -e " ${YELLOW} Run: python3 /tmp/cl-tty-feature-test2.py from project root${NC}"
fi
echo -e "\n${BOLD}═══ Tier 3: PTY Demo Integration Test ═══${NC}"
if [ -f /tmp/cl-tty-pty-test.py ]; then
if python3 /tmp/cl-tty-pty-test.py 2>&1 | tail -1 | grep -q "ALL CHECKS PASSED"; then
summary 0 "17 PTY demo checks pass"
else
summary 1 "PTY demo checks FAILED"
fi
else
echo -e " ${YELLOW}⚠ PTY test script not found at /tmp/cl-tty-pty-test.py${NC}"
echo -e " ${YELLOW} Run: python3 /tmp/cl-tty-pty-test.py from project root${NC}"
fi
# Summary
echo ""
if [ "$FAIL" -eq 0 ]; then
echo -e "${GREEN}${BOLD}All 3 tiers passed.${NC}"
else
echo -e "${RED}${BOLD}Some tiers failed.${NC}"
fi
exit "$FAIL"