Skip to content

Testing ​

motioncore ​

bash
cargo test                    # all host crates: protocol, firmware runtime, planner, graph, plugins, link, gRPC end-to-end
cargo clippy --all-targets
cargo build -p motioncore-board-stm32f4 --profile firmware --target thumbv7em-none-eabihf
cargo build -p motioncore-board-rp2040  --profile firmware --target thumbv6m-none-eabi

Because the firmware runtime (firmware-core, firmware-stepper, firmware-pio-step) is no_std and hardware-independent, it is tested on the host. firmware-pio-step includes an emulator for its PIO program, so pulse encoding and windowing are tested without a Pico. crates/core/tests/e2e.rs exercises the gRPC API end to end against the virtual MCU.

Hardware validation is manual; see STM32F411 bring-up and RP2040 validation.

Fault injection ​

Start the engine with --enable-fault-injection to enable two debug RPCs:

  • DebugDisconnectMcu — simulate a lost MCU link
  • DebugFailPlugin { id } — make a plugin fail

Never use this with real hardware. The engine logs a warning when it is enabled, and motioncore info shows it.

Gateway and UI ​

ratavyr and sindrava have their own test suites, including integration and end-to-end tests that run against this engine with its virtual MCU:

What the test strategy covers ​

KindExamples
UnitKinematics, trajectory constraints, graph resolution, manifest validation
ProtocolFraming, CRC failures, sequence behaviour, version mismatches
SimulationThe virtual MCU executes the same commands as hardware
Fault injectionUnplugged MCU, stopped heartbeat, plugin crash, buffer underrun
Hardware-in-the-loopOne motor, limit switch, E-stop / drive-disable verification (manual, pending)
TimingStep jitter, maximum sustainable step rate, clock drift, queue latency (manual, pending)
Build reproducibilitySame pinned inputs produce auditable artifacts

Apache-2.0 OR MIT. Not a certified safety system — always use an independent hardware E-stop.