blob: 484cecc0e2cda19f85f44aaaf0ded16b273f9db6 [file] [log] [blame] [view]
andybons6eaa0c0d2015-08-26 20:12:521# Code Coverage
andybons3322f762015-08-24 21:37:092
andybons6eaa0c0d2015-08-26 20:12:523## Categories of coverage
andybons3322f762015-08-24 21:37:094
andybons6eaa0c0d2015-08-26 20:12:525* executed - this line of code was hit during execution
6* instrumented - this line of code was part of the compilation unit, but not
7 executed
8* missing - in a source file, but not compiled.
9* ignored - not an executable line, or a line we don't care about
andybons3322f762015-08-24 21:37:0910
andybons6eaa0c0d2015-08-26 20:12:5211Coverage is calculated as `exe / (inst + miss)`. In general, lines that are in
12`miss` should be ignored, but our exclusion rules are not good enough.
andybons3322f762015-08-24 21:37:0913
andybons6eaa0c0d2015-08-26 20:12:5214## Buildbots
andybons3322f762015-08-24 21:37:0915
andybons6eaa0c0d2015-08-26 20:12:5216Buildbots are currently on the
17[experimental waterfall](http://build.chromium.org/buildbot/waterfall.fyi/waterfall).
18The coverage figures they calculate come from running some subset of the
19chromium testing suite.
20
21* [Linux](http://build.chromium.org/buildbot/waterfall.fyi/builders/Linux%20Coverage%20(dbg))
22 - uses `gcov`
23* [Windows](http://build.chromium.org/buildbot/waterfall.fyi/builders/Win%20Coverage%20%28dbg%29)
24* [Mac](http://build.chromium.org/buildbot/waterfall.fyi/builders/Mac%20Coverage%20%28dbg%29)
andybons3322f762015-08-24 21:37:0925
26Also,
andybons3322f762015-08-24 21:37:0927
andybons6eaa0c0d2015-08-26 20:12:5228* [Coverage dashboard](http://build.chromium.org/buildbot/coverage/)
29* [Example coverage summary](http://build.chromium.org/buildbot/coverage/linux-debug/49936/)
30 - the coverage is calculated at directory and file level, and the directory
31 structure is navigable via the **Subdirectories** table.
32
33## Calculating coverage locally
andybons3322f762015-08-24 21:37:0934
35TODO
36
andybons6eaa0c0d2015-08-26 20:12:5237## Advanced Tips
andybons3322f762015-08-24 21:37:0938
andybons6eaa0c0d2015-08-26 20:12:5239Sometimes a line of code should never be reached (e.g., `NOTREACHED()`). These
40can be marked in the source with `// COV_NF_LINE`. Note that this syntax is
41exact.