
This CL updates the documentation for code coverage. TBR=jbudorick@chromium.org Bug: 974379 Change-Id: If9abde5ce40793a7a4d265703fb695126d8f0e56 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1663371 Commit-Queue: Yuke Liao <liaoyuke@chromium.org> Reviewed-by: John Budorick <jbudorick@chromium.org> Reviewed-by: Erik Staab <estaab@chromium.org> Cr-Commit-Position: refs/heads/master@{#671397}
2.5 KiB
Code Coverage in Gerrit
Tests are critical because they find bugs and regressions, enforce better designs and make code easier to maintain. Code coverage helps you ensure your tests are thorough.
Chromium CLs can show a line-by-line breakdown of test coverage. You can use the code coverage trybot to ensure you only submit well-tested code.
To see code coverage for a Chromium CL, trigger the code coverage trybot linux-coverage-rel:
Once the build finishes and code coverage data is processed successfully, look at the right column of the side by side diff view to see coverage information:
The code coverage tool currently supports C/C++ code for Chrome on Linux; support for more platforms and more languages is in progress.
The code coverage trybot has been rolled out to a 10% experiment, and once we're more comfortable in its stability, we plan to enable it by default and expand it to more platforms.
Contacts
Reporting problems
For any breakage report and feature requests, please file a bug.
Mailing list
For questions and general discussions, please join code-coverage group.
FAQ
Why is coverage not shown even though the try job finished successfully?
There are several possible reasons:
- A particular source file/test may not be available on a particular project or
platform. As of now, only
chromium/src
project andLinux
platform is supported. - There is a bug in the pipeline. Please file a bug to report the breakage.
How does it work?
Please refer to code_coverage.md for how code coverage works in Chromium in general, and specifically, for per-CL coverage in Gerrit, the clang_code_coverage_wrapper is used to compile and instrument ONLY the source files that are affected by the CL for the sake of performance and a chromium-coverage Gerrit plugin is used to display code coverage information in Gerrit.