Fake Drivers: A Practical Guide To Zephyr Test Doubles
summary
Explains how Zephyr test doubles are implemented as fake device drivers that satisfy driver API dependencies without changing the DUT, using the single‑header Fake Function Framework (FFF, MIT, ~6000 LOC) to generate spies, stubs and delegates; shows concrete fake drivers (CAN introduced 2022, LEDs, EEPROM, PWM, regulator, RCC, stepper), details driver anatomy (device tree binding, Kconfig, CMake, impl, public header), and lists pitfalls: must define FFF globals once, reset fakes between test cases, and install custom delegates for output parameters to avoid uninitialized memory; some fakes are verified fakes that pass API tests.
AI-written summary · about
