
code_coverage.md cocoa_tips_and_tricks.md closure_compilation.md clang_format.md clang_tool_refactoring.md clang.md R=nodir BUG=524256 Review URL: https://codereview.chromium.org/1306233003 Cr-Commit-Position: refs/heads/master@{#345652}
1.5 KiB
1.5 KiB
Code Coverage
Categories of coverage
- executed - this line of code was hit during execution
- instrumented - this line of code was part of the compilation unit, but not executed
- missing - in a source file, but not compiled.
- ignored - not an executable line, or a line we don't care about
Coverage is calculated as exe / (inst + miss)
. In general, lines that are in
miss
should be ignored, but our exclusion rules are not good enough.
Buildbots
Buildbots are currently on the experimental waterfall. The coverage figures they calculate come from running some subset of the chromium testing suite.
Also,
- Coverage dashboard
- Example coverage summary
- the coverage is calculated at directory and file level, and the directory structure is navigable via the Subdirectories table.
Calculating coverage locally
TODO
Advanced Tips
Sometimes a line of code should never be reached (e.g., NOTREACHED()
). These
can be marked in the source with // COV_NF_LINE
. Note that this syntax is
exact.