11#! /bin/bash
2- # Local CI testing — GCC + ASan + LeakSanitizer in Docker.
2+ # Local CI testing — mirrors GitHub Actions for all Docker-capable platforms .
33#
44# Coverage:
55# arm64: Native on Apple Silicon (fast, ~3 min)
88# Windows: CI only (no Docker support on Mac)
99#
1010# Usage:
11- # ./test-infrastructure/run.sh # arm64 test (default, fast)
12- # ./test-infrastructure/run.sh all # arm64 + amd64 in parallel
13- # ./test-infrastructure/run.sh amd64 # amd64 only
11+ # ./test-infrastructure/run.sh # test + build arm64 (default)
12+ # ./test-infrastructure/run.sh all # test + build, arm64 + amd64
13+ # ./test-infrastructure/run.sh test # test only (ASan + LeakSan)
14+ # ./test-infrastructure/run.sh build # production build only (-O2 -Werror)
15+ # ./test-infrastructure/run.sh amd64 # test + build amd64 only
1416# ./test-infrastructure/run.sh lint # clang-format + cppcheck
1517# ./test-infrastructure/run.sh shell # debug shell (arm64)
16- # ./test-infrastructure/run.sh shell-amd64 # debug shell (amd64)
1718
1819set -euo pipefail
1920
2021ROOT=" $( cd " $( dirname " $0 " ) /.." && pwd) "
2122COMPOSE=" docker compose -f $ROOT /test-infrastructure/docker-compose.yml"
2223
23- case " ${1:- test } " in
24- test|arm64 )
25- echo " === Linux arm64 (GCC + ASan + LeakSanitizer ) ==="
24+ case " ${1:- full } " in
25+ full )
26+ echo " === Linux arm64: test (ASan+LeakSan) + production build (-O2 ) ==="
2627 $COMPOSE run --rm test
28+ $COMPOSE run --rm build
29+ ;;
30+ test)
31+ echo " === Linux arm64: test (ASan + LeakSanitizer) ==="
32+ $COMPOSE run --rm test
33+ ;;
34+ build)
35+ echo " === Linux arm64: production build (-O2 -Werror) ==="
36+ $COMPOSE run --rm build
2737 ;;
2838 amd64)
29- echo " === Linux amd64 via QEMU (GCC + ASan + LeakSanitizer) ==="
39+ echo " === Linux amd64 via QEMU: test + build ==="
3040 $COMPOSE run --rm test-amd64
41+ $COMPOSE run --rm build-amd64
3142 ;;
3243 all)
33- echo " === Testing arm64 + amd64 in parallel ==="
34- $COMPOSE run --rm -d test
44+ echo " === All platforms: test + build ==="
45+ echo " --- arm64 test ---"
46+ $COMPOSE run --rm test
47+ echo " --- arm64 build ---"
48+ $COMPOSE run --rm build
49+ echo " --- amd64 test ---"
3550 $COMPOSE run --rm test-amd64
36- echo " === Waiting for arm64... ==="
37- # docker compose run -d returns immediately; wait for the container
38- $COMPOSE wait test 2> /dev/null || true
51+ echo " --- amd64 build ---"
52+ $COMPOSE run --rm build-amd64
3953 echo " === All platforms passed ==="
4054 ;;
4155 lint)
@@ -46,12 +60,8 @@ case "${1:-test}" in
4660 echo " === Debug shell (Linux arm64) ==="
4761 $COMPOSE run --rm --entrypoint bash test
4862 ;;
49- shell-amd64)
50- echo " === Debug shell (Linux amd64 via QEMU) ==="
51- $COMPOSE run --rm --entrypoint bash test-amd64
52- ;;
5363 * )
54- echo " Usage: $0 {test|arm64 |amd64|all|lint|shell|shell-amd64 }"
64+ echo " Usage: $0 {full| test|build |amd64|all|lint|shell}"
5565 exit 1
5666 ;;
5767esac
0 commit comments