-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_all_tests.sh
More file actions
executable file
·79 lines (60 loc) · 1.97 KB
/
run_all_tests.sh
File metadata and controls
executable file
·79 lines (60 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env bash
set -u
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT_DIR"
export PYTHONPATH="$ROOT_DIR${PYTHONPATH:+:$PYTHONPATH}"
TOTAL_CHECKS=0
FAILED_CHECKS=0
run_check() {
local title="$1"
shift
TOTAL_CHECKS=$((TOTAL_CHECKS + 1))
echo "$title"
local output
output="$("$@" 2>&1)"
local status=$?
local summary
summary="$(printf '%s\n' "$output" | tail -n 1)"
if [[ -z "$summary" ]]; then
summary="(no output)"
fi
if (( status == 0 )); then
printf 'PASS: %s\n\n' "$summary"
return 0
fi
printf 'FAIL: %s\n' "$summary"
echo "---- recent output ----"
printf '%s\n' "$output" | tail -n 20
echo "-----------------------"
echo ""
FAILED_CHECKS=$((FAILED_CHECKS + 1))
return 0
}
echo "============================================================"
echo "A7 COMPILER - COMPLETE TEST RESULTS"
echo "============================================================"
echo ""
run_check "Parser & Tokenizer Tests:" \
uv run pytest test/test_parser*.py test/test_tokenizer*.py --tb=no -q
run_check "Semantic Analysis Tests (All):" \
uv run pytest test/test_semantic*.py --tb=no -q
run_check "Compiler/CLI/Backend Tests:" \
uv run pytest \
test/test_ast_preprocessor.py \
test/test_cli_failures.py \
test/test_iterative_traversal.py \
test/test_stdlib_registry.py \
test/test_codegen_zig.py \
--tb=no -q
run_check "Examples E2E Verification (compile/build/run/output):" \
uv run python scripts/verify_examples_e2e.py
run_check "Error Stage Verification (mode/format matrix):" \
uv run python scripts/verify_error_stages.py --mode-set all --format both
run_check "TOTAL (All Pytest Tests):" \
uv run pytest --tb=no -q
PASSED_CHECKS=$((TOTAL_CHECKS - FAILED_CHECKS))
echo "============================================================"
echo "Summary: ${PASSED_CHECKS}/${TOTAL_CHECKS} checks passed"
if (( FAILED_CHECKS > 0 )); then
exit 1
fi