Skip to main content
This guide assumes you have CruciHiL installed. If not, start with Installation. All steps below use only the virtual backend — no CAN hardware, no ECU, no special OS configuration needed.

Step 1 — Scaffold the hello_world example

The scaffold command drops a self-contained, runnable example into your current directory:
This creates:

Step 2 — Run the suite

Expected output:

Step 3 — Understand the test

Open tests/hello.py:
A few things to notice:
  • async def — all tests are coroutines. CruciHiL uses asyncio throughout.
  • rig: Rig — the framework injects the Rig object. Tests never construct it.
For a signal-level test, scaffold the can_signals example (crucihil scaffold --example can_signals). Its tests use rig.can.expect():
No CAN interface name, no backend-specific code — this same function call works against a virtual backend in CI and a PEAK adapter on your bench. The YAML manifest declares the setup steps that run before the function:
The sim.set step puts a value into the virtual bus; sim.start begins broadcasting the CAN message at its DBC-defined cycle time. The test function then asserts on the decoded signal value.

Step 4 — Get a report

Add --html to generate a self-contained HTML report:
Open report.html in any browser — per-test status, duration, error messages, and signal trace data. For JUnit XML (CI integration):

Where to go next

Write your own tests

Full Rig Python API — send, expect, fault injection, sim control.

Connect real hardware

Wire up SocketCAN, PEAK, or a custom backend in the rig TOML.

Analyze a firmware component

Use crucihil analyze to extract the signal interface of a C/C++ SWC.

Connect an AI assistant

Wire Claude or Copilot to your rig and test history via MCP.