CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

testland/embedded-coverage-strategy-reference

Use when deciding what code coverage level embedded C/C++ needs (statement, branch, MC/DC) and wiring gcov or llvm-cov into the build: host vs QEMU instrumentation, MISRA-C and DO-178C expectations by safety level, and report formats.

Quality

91%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

Overview
Quality
Evals
Security
Files

gcov-flag-reference.mdreferences/

gcov flag reference for embedded coverage

Deep reference for the embedded-coverage-strategy-reference SKILL.md. Consult when reading a .gcov report or reaching past the --coverage / gcov -b -c basics shown in the SKILL.

gcov command-line flags

Key flags from the GCC gcov invocation page (gcc.gnu.org/onlinedocs/gcc/Invoking-Gcov.html):

FlagLong formEffect
-a--all-blocksWrite per-basic-block counts
-b--branch-probabilitiesWrite branch frequencies + summary to stdout
-c--branch-countsBranch frequencies as counts not percentages
-f--function-summariesPer-function coverage on top of file-level
-n--no-outputSuppress the .gcov file
-p--preserve-pathsPreserve full path in generated filenames
-u--unconditional-branchesInclude unconditional branches in -b output
--json-format-Emit .gcov.json.gz (gzip-compressed JSON, "does not require source code for generation")

Reading the .gcov text report

The text .gcov file annotates each source line with an execution count. Two sentinels matter:

  • - marks a non-executable line (declaration, blank, comment).
  • ##### marks an executable line that was never run - the reads worth chasing.

-b -c together give branch coverage as raw counts, which is what an embedded branch-coverage gate reads. For per-operand visibility on short-circuit && / ||, gcov is not enough - use clang -fcoverage-mcdc (see the SKILL's LLVM section).

SKILL.md

tile.json