Skip to content

Commit

Permalink
kernel: init: fix coverage gap
Browse files Browse the repository at this point in the history
We don't get any coverage past when we dump the coverage data,
so exclude the end of the function and move setting the main
thread as nonessential to immediately before the coverage dump.
The comment was also amended.

Signed-off-by: Andrew Boie <[email protected]>
  • Loading branch information
Andrew Boie authored and nashif committed Jun 18, 2019
1 parent fe228a8 commit 8e05333
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,12 @@ static void bg_thread_main(void *unused1, void *unused2, void *unused3)

main();

/* Mark nonessenrial since main() has no more work to do */
_main_thread->base.user_options &= ~K_ESSENTIAL;

/* Dump coverage data once the main() has exited. */
gcov_coverage_dump();

/* Terminate thread normally since it has no more work to do */
_main_thread->base.user_options &= ~K_ESSENTIAL;
}
} /* LCOV_EXCL_LINE ... because we just dumped final coverage data */

/* LCOV_EXCL_START */

Expand Down

0 comments on commit 8e05333

Please sign in to comment.