Integration tests and performance benchmarks for smolvm.
| File | Description | Requires VM |
|---|---|---|
test_cli.sh |
Basic CLI tests (--version, --help, flags) | No |
test_machine.sh |
Machine lifecycle + run tests | Yes |
test_smolfile.sh |
Smolfile parsing and integration | Yes |
test_container.sh |
Container lifecycle tests (create, exec, stop) | Yes |
test_api.sh |
HTTP API tests (smolvm serve) |
Yes |
test_pack.sh |
Pack command tests (pack, run, daemon mode) | Yes |
| File | Description |
|---|---|
bench_vm_startup.sh |
Measures VM cold start time |
bench_container.sh |
Measures container execution time (cold/warm) |
./tests/run_all.sh./tests/run_all.sh cli # CLI tests only
./tests/run_all.sh machine # Machine tests only
./tests/run_all.sh container # Container tests only
./tests/run_all.sh api # HTTP API tests only
./tests/run_all.sh pack # Pack tests only
./tests/run_all.sh pack-quick # Pack tests (skip large images)./tests/run_all.sh bench # All benchmarks
./tests/run_all.sh bench-vm # VM startup benchmark
./tests/run_all.sh bench-container # Container benchmark./tests/test_cli.sh
./tests/test_machine.sh
./tests/test_smolfile.shSMOLVM=/path/to/smolvm ./tests/run_all.shUnit tests are run via cargo (no VM required):
cargo test --lib- CLI tests: Only require the smolvm binary
- All other tests: Require VM environment (macOS Hypervisor.framework or Linux KVM)
- Benchmarks: Require VM environment, best run on a quiet system
Tests automatically look for the smolvm binary in:
$SMOLVMenvironment variabledist/smolvm-*-darwin-*/smolvmordist/smolvm-*-linux-*/smolvmtarget/release/smolvm
The common.sh file provides shared test utilities:
find_smolvm- Locate the smolvm binaryinit_smolvm- Initialize and validate the binaryrun_test- Run a test function with pass/fail trackingprint_summary- Print test results summaryensure_machine_running- Start the default machinecleanup_machine- Stop the default machineextract_container_id- Parse container ID from command outputcleanup_container- Force remove a container
| Suite | Tests |
|---|---|
| CLI | 10 |
| Machine | 30 |
| Smolfile | 28 |
| Container | 10 |
| API | 16 |
| Pack | 25 |
| Total | 119 |