emul: Create an emulation implementation
Create a header file and implementation for emulators. Set up a linker list so that emulators can be found and initialised at start-up. Emulators are used to emulate hardware devices, to support testing of various subsystems. For example, it is possible to write an emulator for an I2C compass such that it appears on the I2C bus and can be used just like a real hardware device. Emulators often implement special features for testing. For example a compass may support returning bogus data if the I2C bus speed is too high, or may return invalid measurements if calibration has not yet been completed. This allows for testing that high-level code can handle these situations correctly. Test coverage can therefore approach 100% if all failure conditions are emulated. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no> Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
dce9580490
commit
302d671ea2
8 changed files with 227 additions and 0 deletions
5
subsys/emul/CMakeLists.txt
Normal file
5
subsys/emul/CMakeLists.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
zephyr_library()
|
||||
|
||||
zephyr_library_sources_ifdef(CONFIG_EMUL emul.c)
|
Loading…
Add table
Add a link
Reference in a new issue