Streamlining Testing with Generic Tests and Emulators
summary
A generic test plus an emulator backend API lets one reusable test exercise many sensor drivers by discovering supported channels via get_sample_range, choosing five interpolated SI values, calling set_channel to program the emulator’s register store and data‑ready bit, reading back through the driver, unshifting q31 values and comparing with an epsilon tolerance. Implementation uses Zephyr emul_sensor backend, fixed‑point q31 shift/unshift arithmetic, and is live (covers 3–4 sensors including an AKM9918C); it runs in CI and catches init and range bugs.
AI-written summary · about
chapters (10)
- 0:00Zephyr emulation introduction
- 1:47Zephyr emulator basics
- 4:13Sensor driver bugs and gaps
- 8:10Standardizing emulator APIs
- 10:38Backend emulator API structure
- 14:14Fix-point numbers in sensors
- 19:33AKM9918C compass API
- 24:49Generic test implementation
- 29:06Benefits and future of testing
- 30:53Q&A
related talks
37mStreamlining Testing with Generic Tests and Emulators
40mZephyr Off-Chip Peripheral Emulation
13mZephyr Unit Tests and Emulators at Google
26mUnit Testing Memory Mapped Device Drivers
44mTest Strategy for Zephyr
32mUsing Customerized QEMU Co-simulation for Development and Test of Zephyr Applications
44mTest Strategy for Zephyr
34mOpen Loop Testing: The Missing Link for Embedded Testing?
