Commit d3b46273 authored by Yuke Liao's avatar Yuke Liao Committed by Commit Bot

[Coverage] Add documentation for Clang source based code coverage.

Change-Id: I6c3920ca92cf05b41fe69c74936cc0578841847f

Bug: chromium:821851
Change-Id: I6c3920ca92cf05b41fe69c74936cc0578841847f
Reviewed-on: https://chromium-review.googlesource.com/952296
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Reviewed-by: default avatarMax Moroz <mmoroz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543125}
parent 531782d0
# Code coverage in Chromium
## Coverage script.
[Coverage script] helps to generate clang source-based code coverage report
locally and make it easy to identify under-covered areas.
Currently, this script supports running on Linux, Mac, iOS and ChromeOS
platforms, and supports displaying code coverage results per directory, per
component and per file.
In order to generate code coverage report, you need to first add
`use_clang_coverage=true` and `is_component_build=false` GN flags to args.gn
file in your build output directory (e.g. out/coverage).
Existing implementation requires `is_component_build=false` flag
because coverage info for dynamic libraries may be missing and
`is_component_build` is set to true by `is_debug` unless it is explicitly set
to false.
Example usage:
```
gn gen out/coverage --args='use_clang_coverage=true is_component_build=false'
gclient runhooks
python tools/code_coverage/coverage.py crypto_unittests url_unittests
-b out/coverage -o out/report -c 'out/coverage/crypto_unittests'
-c 'out/coverage/url_unittests --gtest_filter=URLParser.PathURL'
-f url/ -f crypto/
```
For more options, please refer to the script.
## Reporting problems
For any breakage report and feature requests, please [file a bug].
[Coverage script]: https://cs.chromium.org/chromium/src/tools/code_coverage/coverage.py
[file a bug]: https://bugs.chromium.org/p/chromium/issues/entry?components=Tools%3ECodeCoverage
\ No newline at end of file
...@@ -11,10 +11,9 @@ ...@@ -11,10 +11,9 @@
"use_clang_coverage=true" and "is_component_build=false" GN flags to args.gn "use_clang_coverage=true" and "is_component_build=false" GN flags to args.gn
file in your build output directory (e.g. out/coverage). file in your build output directory (e.g. out/coverage).
Clang Source-based Code Coverage requires "is_component_build=false" flag Existing implementation requires "is_component_build=false" flag because
because: There will be no coverage info for libraries in component builds and coverage info for dynamic libraries may be missing and "is_component_build"
"is_component_build" is set to true by "is_debug" unless it is explicitly set is set to true by "is_debug" unless it is explicitly set to false.
to false.
Example usage: Example usage:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment