CONFIG_EMUL

Emulation drivers

Type: bool

Help

Enable Emulation Driver Configuration
These drivers 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.

Default

  • y

Kconfig definitions

At <Zephyr>/boards/posix/native_posix/Kconfig.defconfig:86

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:22

Menu path: (Top)

config EMUL
    bool
    default y
    depends on I2C && BOARD_NATIVE_POSIX

At <Zephyr>/subsys/emul/Kconfig:9

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:44<Zephyr>/subsys/Kconfig:21

Menu path: (Top) → Sub Systems and OS Services

menuconfig EMUL
    bool "Emulation drivers"
    help
      Enable Emulation Driver Configuration
      These drivers 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.

(The ‘depends on’ condition includes propagated dependencies from ifs and menus.)