zephyr/subsys/testsuite/ztest
Roman Studenikin fdd81f87c2 testsuite: coverage: Add CONFIG_ZTEST_COVERAGE_RESET_BEFORE_TESTS
Add an option to reset gcov counters before running tests.
This ensures that only code lines triggered by test itself are counted in
the coverage report and all the board initialization code and pre-test
bootstrap is not counted. This is useful when, for example, you are
testing code that is also executed during bootup

Test Plan:
west build -p always -b qemu_x86_64 tests/ztest/base/ -- \
-DCONFIG_COVERAGE=y -DCONFIG_COVERAGE_GCOV=y -DCONFIG_COVERAGE_DUMP=y \
-DCONFIG_ZTEST_COVERAGE_RESET_BEFORE_TESTS=y
ninja -Cbuild run | tee log.log

Signed-off-by: Roman Studenikin <srv@meta.com>
2024-06-12 14:32:04 +03:00
..
include/zephyr ztest: Add macros for comparing strings 2024-06-11 11:39:36 +01:00
src testsuite: coverage: Add CONFIG_ZTEST_COVERAGE_RESET_BEFORE_TESTS 2024-06-12 14:32:04 +03:00
unittest/include/zephyr/arch ztest: include: unittest: relocate cpu.h and include only if unit-test 2024-05-10 11:50:36 +02:00
CMakeLists.txt testsuite: coverage: Add CONFIG_ZTEST_COVERAGE_RESET_BEFORE_TESTS 2024-06-12 14:32:04 +03:00
Kconfig testsuite: coverage: Add CONFIG_ZTEST_COVERAGE_RESET_BEFORE_TESTS 2024-06-12 14:32:04 +03:00