Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: drivers: coredump: Enable code coverage #65946

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/drivers/coredump/coredump_api/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,29 @@

#define TEST_MEMORY_VALUE_8 0xbabababa

#ifdef CONFIG_COVERAGE_DUMP
#include <zephyr/debug/gcov.h>
#endif

static uint32_t values_to_dump[3];
static struct coredump_mem_region_node dump_region0 = {
.start = (uintptr_t)&values_to_dump,
.size = sizeof(values_to_dump)
};

void k_sys_fatal_error_handler(unsigned int reason, const z_arch_esf_t *pEsf)
{
ARG_UNUSED(pEsf);

printk("%s as expected; reason = %u; halting ...\n", __func__, reason);

#ifdef CONFIG_COVERAGE_DUMP
gcov_coverage_dump(); /* LCOV_EXCL_LINE */
#endif
k_fatal_halt(reason);
}


static void test_coredump_callback(uintptr_t dump_area, size_t dump_area_size)
{
uint32_t expected_size = DT_PROP_BY_IDX(DT_NODELABEL(coredump_devicecb), memory_regions, 1);
Expand Down