37 lines
1.4 KiB
Markdown
37 lines
1.4 KiB
Markdown
Layered Test Suite Architecture (PR‑8.3)
|
||
|
||
Overview
|
||
|
||
- Tests are organized by runtime layer to isolate failures and clarify ownership of behavior.
|
||
- Location: `crates/dev/prometeu-layer-tests/tests/`
|
||
|
||
Layers and representative tests
|
||
|
||
1. Bytecode encode/decode
|
||
- `bytecode_encode_decode.rs` — round‑trip decoding for edge immediates and structure.
|
||
2. Verifier
|
||
- `verifier_closure_reject.rs` — rejects `CALL_CLOSURE` when TOS is not a closure.
|
||
- Rule: verifier tests never run the VM.
|
||
3. VM execution
|
||
- `vm_exec_valid.rs` — executes a tiny valid program; assumes verified input.
|
||
- Rule: VM tests do not depend on the verifier; they prepare ROM directly.
|
||
4. GC behavior
|
||
- `gc_collect_unreachable.rs` — unrooted closure is reclaimed; rooted one survives.
|
||
5. Scheduler behavior
|
||
- `scheduler_determinism.rs` — deterministic FIFO ordering for same‑tick wakeups.
|
||
|
||
Running the layered suite
|
||
|
||
- Run just the layered tests: `cargo test -p prometeu-layer-tests`
|
||
- Run the entire workspace: `cargo test`
|
||
|
||
Separation of concerns
|
||
|
||
- No cross‑layer assumptions in these tests.
|
||
- Verifier tests: no `VirtualMachine` execution.
|
||
- VM tests: assume pre‑verified bytecode; interact via public VM APIs only.
|
||
- GC and Scheduler tests: exercise their public APIs directly, without booting the VM.
|
||
|
||
DRY helpers
|
||
|
||
- Shared utilities should live in `crates/dev/prometeu-test-support` when needed. The current minimal suite avoids duplication by using tiny local helpers. |