This may just be more of a Zephyr question but wondering if anyone in the Nordic community has experience with this.
I'd like to generate code coverage reports when running tests using the Zephyr Test Framework (Ztest). This works well when testing on the native_posix platform, but when running on actual hardware e.g.:
twister -T . -j1 --device-testing --device-serial /dev/ttyACM2 --device-serial-baud 115200 -p nrf5340dk_nrf5340_cpuapp --coverage
Coverage is disabled due to unsatisfied dependency HAS_COVERAGE_SUPPORT:
warning: COVERAGE (defined at subsys/testsuite/Kconfig:33) was assigned the value 'y' but got thevalue 'n'. Check these unsatisfied dependencies: HAS_COVERAGE_SUPPORT (=n). Seedocs.zephyrproject.org/.../kconfig.html and/or look up COVERAGE in themenuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values,and Kconfig - Tips and Best Practices sections of the manual might be helpful too.
The code coverage report generation is only available on boards
with enough spare RAM to buffer the coverage data, or on boards
based on the POSIX ARCH.