2026-03-24 13:40:42 +00:00

1.4 KiB
Raw Blame History

Layered Test Suite Architecture (PR8.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 — roundtrip 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 sametick 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 crosslayer assumptions in these tests.
  • Verifier tests: no VirtualMachine execution.
  • VM tests: assume preverified 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.