This guide summarizes testing layers and commands in this repository.
Toolchain note: use stock Zig + elf2sbpf for on-chain builds.
- SDK unit tests (
sdk/) — core types, serialization - Program SDK tests (
src/) — syscall stubs and on-chain helpers - Client SDK tests (
client/) — RPC and transaction utilities - Integration tests (
program-test/,client/integration/) - Anchor tests (
anchor/)
zig build test --summary allcd sdk
zig build test --summary allcd client
zig build test --summary all# Option A: surfpool (CI uses this)
surfpool start --no-tui &
# Option B: solana-test-validator
solana-test-validator &
cd client
zig build integration-test --summary all./program-test/test.shcd anchor
zig build test --summary allcd examples/programs
zig build -Dexample=hello_world -Delf2sbpf-bin=/absolute/path/to/elf2sbpf
zig build -Dexample=counter -Delf2sbpf-bin=/absolute/path/to/elf2sbpf
zig build -Dexample=transfer_lamports -Delf2sbpf-bin=/absolute/path/to/elf2sbpf- Format:
zig fmt/ project formatter checks - SDK:
cd sdk && zig build test --summary all - Client:
cd client && zig build test --summary all - Program SDK:
zig build test --summary all - Integration:
./program-test/test.sh /path/to/zig /path/to/elf2sbpf - Examples:
cd examples/programs && zig build -Dexample=hello_world -Delf2sbpf-bin=/path/to/elf2sbpf(repeat forcounter/transfer_lamports) - Anchor:
cd anchor && zig build test --summary all
- Prefer stock Zig 0.16.x.
- Some tests require a local validator (see Client Integration).