summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Bartell <pbartell@amazon.com>2021-03-30 16:28:07 -0700
committerPaul Bartell <paul.bartell@gmail.com>2021-03-31 13:28:45 -0700
commit19271ddc8dc79d52a812a070d1687f3d801bed19 (patch)
tree9409b713563cb29435305c8a9a5297bf506f47fe
parente39c34ba7e3c146d81b05f73e272e90fa645e2e5 (diff)
downloadfreertos-git-19271ddc8dc79d52a812a070d1687f3d801bed19.tar.gz
Work around gcov json output bug
When gcov outputs into it's intermediate json format, sometimes it marks blocks as unexecuted but also sets an execution count != 0. In this case, the "count" field is correct, but the "unexecuted_block" field is incorrect. When outputting lcov formatted coverage data in filtercov.py, only output a branch coverage data lines (BRDA) with a "-" for the "taken" field when both count==0 and unexecuted_block==true in the input gcov json intermediate file.
-rwxr-xr-xFreeRTOS/Test/CMock/tools/filtercov.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/FreeRTOS/Test/CMock/tools/filtercov.py b/FreeRTOS/Test/CMock/tools/filtercov.py
index 35a58c16e..62ffed3a9 100755
--- a/FreeRTOS/Test/CMock/tools/filtercov.py
+++ b/FreeRTOS/Test/CMock/tools/filtercov.py
@@ -308,7 +308,7 @@ def convert_to_lcov_info(args, covdata, outfile):
# Handle branch data
for target_branch in target_line["branches"]:
branch_count = "-"
- if target_line["unexecuted_block"] or target_line["count"] == 0:
+ if target_line["unexecuted_block"] and target_line["count"] == 0:
branch_count = "-"
elif "count" in target_branch:
branch_count = target_branch["count"]