scripts: twisterlib: coverage: ignore __ASSERT branches
Disable branch coverage for the `__ASSERT` family of macros. Covering all of the assertion branches by definition means triggering the assertion, which can be either challenging or impossible to exercise, and in either case results in the immediate termination of the test. Signed-off-by: Jordan Yates <jordan@embeint.com>
This commit is contained in:
parent
53bd9ead64
commit
af0cbb19c0
1 changed files with 3 additions and 0 deletions
|
|
@ -428,5 +428,8 @@ def run_coverage(testplan, options):
|
|||
# Ignore branch coverage on LOG_* and LOG_HEXDUMP_* macros
|
||||
# Branch misses are due to the implementation of Z_LOG2 and cannot be avoided
|
||||
coverage_tool.add_ignore_branch_pattern(r"^\s*LOG_(?:HEXDUMP_)?(?:DBG|INF|WRN|ERR)\(.*")
|
||||
# Ignore branch coverage on __ASSERT* macros
|
||||
# Covering the failing case is not desirable as it will immediately terminate the test.
|
||||
coverage_tool.add_ignore_branch_pattern(r"^\s*__ASSERT(?:_EVAL|_NO_MSG|_POST_ACTION)?\(.*")
|
||||
coverage_completed = coverage_tool.generate(options.outdir)
|
||||
return coverage_completed
|
||||
|
|
|
|||
Loading…
Reference in a new issue