Skip to content

Commit

Permalink
kernel: ignore z_fatal_halt() from code coverage
Browse files Browse the repository at this point in the history
The reason we decide to ignore it in code coverage:
1.No test case can cover the function for code coverage.
2.Even if we added a test for testing, it would be marked as
  "never be called by other code" because the function cause
  CPU halted and it can't return.

Signed-off-by: Peng Su <[email protected]>
  • Loading branch information
Intel-sp authored and ioannisg committed Aug 24, 2019
1 parent 8cd7cd4 commit 1084f48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/fatal.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,13 @@ void z_fatal_print(const char *fmt, ...)
}
#endif /* CONFIG_LOG || CONFIG_PRINTK */

/* LCOV_EXCL_START */
FUNC_NORETURN void k_fatal_halt(unsigned int reason)
{
z_arch_system_halt(reason);
}
/* LCOV_EXCL_STOP */


void z_fatal_error(unsigned int reason, const z_arch_esf_t *esf)
{
Expand Down

0 comments on commit 1084f48

Please sign in to comment.