scripts/verify.ps1 runs every gate in one command.
Host test suites
The firmware test suites run against the host simulator. They prove module behavior, safety invariants, and protocol correctness before any hardware exists.Studio and link tests
EVCore Studio and the firmware communicate over protocol v2. The link tests prove that Studio and the firmware agree on discovery, commands, reports, and error handling.Running the gates
Run all gates with a single PowerShell command:-Quick to skip CMake and Electron when you only need the fast checks. The script runs:
- Firmware build with strict warnings (
-Werror) and undefined-behavior trapping. - All C test suites via
ctest --preset zig. - Clang static analyzer (
scripts/analyze.ps1), which must report zero findings. - Layer check (
node scripts/check-layers.mjs) for upward includes and cycles. - Requirement trace (
node scripts/trace-requirements.mjs) to confirm every safety requirement has a tagged test. - Studio unit tests (
npm test). - Firmware-link test (
npm run test:firmware-link). - Desktop smoke test (
npm run test:desktop).
Static gates
Beyond runtime tests, the following gates run on every build:- Strict warnings with
-Werror - Undefined-behavior trapping (
-fsanitize=undefined -fsanitize-trap=undefined) - Clang static analyzer covering
core,deadcode,security,unix,nullability, andoptin.portability - Firmware layer check enforced by
scripts/check-layers.mjs - Safety requirement traceability enforced by
scripts/trace-requirements.mjs
Test rules
- A behavior change comes with a test that fails without it.
- Tests that check a shutdown must check the OFF call the driver received, not only the state the firmware reports (SR-12).
- New safety behavior gets a requirement ID in
safety-requirements.mdand a tagged test. - When a test passes on its first run, confirm it can fail: temporarily break the code it covers. The fault matrix, fuzzer, and layer check were all checked this way.
- Every software defect found in the field gets a regression test (roadmap #56).
Simulation limits
The simulator models commanded behavior and injected faults, not electrical physics. A passing host test shows the software follows its rules. It does not show the Brick is electrically safe. Timing is virtual:TICK advances 10 ms.
Next stages
- Scenario tests for motor, controller, sensor, and battery faults against the simulator (roadmap phase 2, #41 to #47).
- ARM cross-build of the portable modules, and later on-target unit tests (#67, #68).
- Hardware-in-the-loop: the same procedure suite on a real board with known loads and known-good and known-faulty parts (#83, #84).
- Bench measurement of fault-response time and shutdown ordering (#82), which no host test can prove.