Рет қаралды 117
The Zephyr® Project strives to deliver the best-in-class RTOS for connected resource-constrained devices, built to be secure and safe. Click here to learn more: www.zephyrproj...
Streamlining Testing with Generic Tests and Emulators - Tristan Honscheid, Google
Validating our codebase with a robust set of tests is crucial to building a high-quality and reliable RTOS, and growing our test coverage continues to be a significant effort for the Zephyr Project. Generic tests, coupled with peripheral emulators implementing a special backend API, provide a mechanism for accelerating driver test development, while also reducing code duplication and building off the existing test and emulation framework. Current practice for testing a Zephyr driver is to develop an emulator that mimics the behavior of the targeted peripheral. A basic pattern is for test code to load expected values into the emulator, read them back through the driver, and compare values. By using a standardized backend emulator API, test code can stimulate emulators and validate driver behavior in a generic way. This process makes it possible to build a “generic test” where a singular test covers significant portions of drivers across a whole class of devices without needing to know the specifics of each device. This talk will cover the implementation of this concept for sensor drivers and how developers can leverage it to rapidly add tests to their own drivers.