Commit 8c0868fe authored by Yuke Liao's avatar Yuke Liao Committed by Commit Bot

[code coverage] Fix code coverage documentation

This CL fixes the code coverage documentation:
1. 'is_debug=false' gn arg is required.
2. Sandbox is working now.
3. Remove obsolete links.

Bug: 1012473
Change-Id: I178f42cd6879fbfaf464d344ee272268ee654ea3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874486
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Reviewed-by: default avatarNodir Turakulov <nodir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708351}
parent 0c63ddaf
...@@ -164,14 +164,14 @@ download the tools manually ([tools link]). ...@@ -164,14 +164,14 @@ download the tools manually ([tools link]).
### Step 1 Build ### Step 1 Build
In Chromium, to compile code with coverage enabled, one needs to add In Chromium, to compile code with coverage enabled, one needs to add
`use_clang_coverage=true` and `is_component_build=false` GN flags to the args.gn `use_clang_coverage=true`, `is_component_build=false` and `is_debug=false` GN
file in the build output directory. Under the hood, they ensure flags to the args.gn file in the build output directory. Under the hood, they
`-fprofile-instr-generate` and `-fcoverage-mapping` flags are passed to the ensure `-fprofile-instr-generate` and `-fcoverage-mapping` flags are passed to
compiler. the compiler.
``` ```
$ gn gen out/coverage \ $ gn gen out/coverage \
--args='use_clang_coverage=true is_component_build=false' --args='use_clang_coverage=true is_component_build=false is_debug=false'
$ gclient runhooks $ gclient runhooks
$ autoninja -C out/coverage crypto_unittests url_unittests $ autoninja -C out/coverage crypto_unittests url_unittests
``` ```
...@@ -322,10 +322,7 @@ only reports generated on Linux and CrOS are available on the ...@@ -322,10 +322,7 @@ only reports generated on Linux and CrOS are available on the
### Is coverage reported for the code executed inside the sandbox? ### Is coverage reported for the code executed inside the sandbox?
Not at the moment until [crbug.com/842424] is resolved. We do not disable the Yes!
sandbox when running the tests. However, if there are any other non-sandbox'ed
tests for the same code, the coverage should be reported from those. For more
information, see [crbug.com/842424].
[assert]: http://man7.org/linux/man-pages/man3/assert.3.html [assert]: http://man7.org/linux/man-pages/man3/assert.3.html
...@@ -342,7 +339,6 @@ information, see [crbug.com/842424]. ...@@ -342,7 +339,6 @@ information, see [crbug.com/842424].
[crbug.com/821617]: https://crbug.com/821617 [crbug.com/821617]: https://crbug.com/821617
[crbug.com/831939]: https://crbug.com/831939 [crbug.com/831939]: https://crbug.com/831939
[crbug.com/834781]: https://crbug.com/834781 [crbug.com/834781]: https://crbug.com/834781
[crbug.com/842424]: https://crbug.com/842424
[crrev.com/c/1172932]: https://crrev.com/c/1172932 [crrev.com/c/1172932]: https://crrev.com/c/1172932
[clang roll]: https://crbug.com/841908 [clang roll]: https://crbug.com/841908
[dead code example]: https://chromium.googlesource.com/chromium/src/+/ac6e09311fcc7e734be2ef21a9ccbbe04c4c4706 [dead code example]: https://chromium.googlesource.com/chromium/src/+/ac6e09311fcc7e734be2ef21a9ccbbe04c4c4706
...@@ -353,4 +349,3 @@ information, see [crbug.com/842424]. ...@@ -353,4 +349,3 @@ information, see [crbug.com/842424].
[How do crashes affect code coverage?]: #how-do-crashes-affect-code-coverage [How do crashes affect code coverage?]: #how-do-crashes-affect-code-coverage
[known issues]: https://bugs.chromium.org/p/chromium/issues/list?q=component:Infra%3ETest%3ECodeCoverage [known issues]: https://bugs.chromium.org/p/chromium/issues/list?q=component:Infra%3ETest%3ECodeCoverage
[tools link]: https://storage.googleapis.com/chromium-browser-clang-staging/ [tools link]: https://storage.googleapis.com/chromium-browser-clang-staging/
[test suite]: https://cs.chromium.org/chromium/src/tools/code_coverage/test_suite.txt
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