Zephyr Unit Tests and Emulators at Google
summary
Chromium EC CI wires twister into Zephyr for incremental builds, parallel runs and nightly full-matrix tests, produces per-test HTML reports and supports test shuffling with a reproducible seed; unit tests use predicates, setup/teardown fixtures and four test flags (including _f for fixtures); Google adds fff mocks and explores assume/expect APIs to skip or defer failures; device emulation plugs into the bus using emul_dt_ins* so drivers run unchanged against emulated peripherals; posix-only rerun by test/suite exists.
AI-written summary · about
chapters (13)
- 0:00Intro
- 0:13Save time with twister
- 2:25ZTEST_SUITE(...)
- 3:44When to use predicates?
- 4:32Modular design: tests
- 5:20Assert, Expect, & Assume
- 6:33Modularity
- 7:39Modular design: test rules
- 8:08Mocking (FFF)
- 9:04Emulating peripherals
- 9:33Enabling Zephyr emulators
- 10:48Defining an emulator
- 11:48Reliability of tests
related talks
37mStreamlining Testing with Generic Tests and Emulators
40mZephyr Off-Chip Peripheral Emulation
46mZephyr Application Development Using TDD: Getting Started
44mTest Strategy for Zephyr
46mZephyr Application Development Using TDD: Getting Started
44mTest Strategy for Zephyr
49mHarnessing the Twister: Zephyr Data-Driven Testing and Insights
49mHarnessing the Twister: Zephyr Data-Driven Testing and Insights
