Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 1 | # Code Coverage in Chromium |
| 2 | |
Roberto Carrillo | 5221fc1 | 2019-01-30 21:34:50 | [diff] [blame] | 3 | ### Coverage Dashboard: [link](https://analysis.chromium.org/p/chromium/coverage) |
Yuke Liao | d3b4627 | 2018-03-14 18:25:14 | [diff] [blame] | 4 | |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 5 | Table of contents: |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 6 | |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 7 | - [Coverage Infrastructure](#coverage-infra) |
| 8 | * [Coverage Builders](#coverage-builders) |
| 9 | * [Coverage Service](#coverage-service) |
| 10 | * [Coverage Clients](#coverage-clients) |
Roberto Carrillo | bc1560e | 2019-01-30 20:08:58 | [diff] [blame] | 11 | - [Local Coverage Script](#local-coverage-script) |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 12 | * [Step 0 Download Tooling](#step-0-download-tooling) |
| 13 | * [Step 1 Build](#step-1-build) |
| 14 | * [Step 2 Create Raw Profiles](#step-2-create-raw-profiles) |
| 15 | * [Step 3 Create Indexed Profile](#step-3-create-indexed-profile) |
| 16 | * [Step 4 Create Coverage Reports](#step-4-create-coverage-reports) |
Max Moroz | d73e45f | 2018-04-24 18:32:47 | [diff] [blame] | 17 | - [Contacts](#contacts) |
| 18 | - [FAQ](#faq) |
Yuke Liao | d3b4627 | 2018-03-14 18:25:14 | [diff] [blame] | 19 | |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 20 | Chromium uses source-based code coverage for clang-compiled languages such as |
| 21 | C++. This [documentation] explains how to use Clang’s source-based coverage |
| 22 | features in general. |
Yuke Liao | d3b4627 | 2018-03-14 18:25:14 | [diff] [blame] | 23 | |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 24 | In this document, we first introduce the code coverage infrastructure that |
| 25 | continuously generates code coverage information for the whole codebase and for |
| 26 | specific CLs in Gerrit. For the latter, refer to |
Roberto Carrillo | 5221fc1 | 2019-01-30 21:34:50 | [diff] [blame] | 27 | [code\_coverage\_in\_gerrit.md](code_coverage_in_gerrit.md). |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 28 | We then present a script that can be used to locally generate code coverage |
| 29 | reports with one command, and finally we provide a description of the |
| 30 | process of producing these reports. |
| 31 | |
| 32 | ## Coverage Infrastructure |
| 33 | |
| 34 | ![coverage infra diagram] |
| 35 | |
| 36 | There are 3 layers in the system: |
| 37 | |
| 38 | ### Coverage Builders |
| 39 | |
| 40 | The first layer is the LUCI builders that |
| 41 | - build instrumented targets, |
| 42 | - run the instrumented tests, |
| 43 | - merge the results into single streams, |
| 44 | - upload data to cloud storage. |
| 45 | |
| 46 | There are two types of builder: |
| 47 | |
| 48 | CI Builder |
| 49 | |
Yuke Liao | 43bbbcd5 | 2019-06-21 19:34:50 | [diff] [blame] | 50 | The code coverage CI Builders periodically build all the test targets and fuzzer |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 51 | targets for a given platform and instrument all available source files. Then |
| 52 | save the coverage data to a dedicated storage bucket. |
| 53 | |
| 54 | CQ Builder |
| 55 | |
| 56 | The code coverage CQ builders instrument only the files changed for a given CL. |
Yuke Liao | 43bbbcd5 | 2019-06-21 19:34:50 | [diff] [blame] | 57 | More information about per-cl coverage info in [this |
Roberto Carrillo | 5221fc1 | 2019-01-30 21:34:50 | [diff] [blame] | 58 | doc](code_coverage_in_gerrit.md). |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 59 | |
| 60 | ### Coverage Service |
| 61 | |
| 62 | The second layer in the system consists of an AppEngine application that |
| 63 | consumes the coverage data from the builders above, structures it and stores it |
| 64 | in cloud datastore. It then serves the information to the clients below. |
| 65 | |
| 66 | ### Coverage Clients |
| 67 | |
| 68 | In the last layer we currently have two clients that consume the service: |
| 69 | |
| 70 | #### Coverage Dashboard |
| 71 | |
| 72 | The [coverage dashboard] front end is hosted in the same application as the |
| 73 | service above. |
| 74 | It shows the full-code coverage reports with links to the builds that generated |
| 75 | them, as well as per-directory and per-component aggregation, and can be drilled |
| 76 | down to the single line of code level of detail. |
| 77 | |
Yuke Liao | 43bbbcd5 | 2019-06-21 19:34:50 | [diff] [blame] | 78 | Refer to the following screenshots: |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 79 | |
| 80 | ##### Directory View |
| 81 | |
Yuke Liao | 43bbbcd5 | 2019-06-21 19:34:50 | [diff] [blame] | 82 | See coverage breakdown by directories (default landing page). |
| 83 | |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 84 | ![coverage dashboard directory view] |
| 85 | |
| 86 | ##### Component View |
| 87 | |
Yuke Liao | 43bbbcd5 | 2019-06-21 19:34:50 | [diff] [blame] | 88 | Use the view dropdown menu to switch between directory and component. |
| 89 | |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 90 | ![coverage dashboard component view] |
| 91 | |
| 92 | ##### Source View |
| 93 | |
Yuke Liao | 43bbbcd5 | 2019-06-21 19:34:50 | [diff] [blame] | 94 | Click on a particular source file in one of the views above to see line-by-line |
| 95 | coverage breakdown, and it's useful to identify: |
| 96 | - Uncovered lines and code blocks that lack test coverage. |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 97 | - Potentially dead code. See [dead code example]. |
Yuke Liao | 43bbbcd5 | 2019-06-21 19:34:50 | [diff] [blame] | 98 | - Hot spots in your code. |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 99 | |
| 100 | ![coverage dashboard file view] |
| 101 | |
Yuke Liao | 43bbbcd5 | 2019-06-21 19:34:50 | [diff] [blame] | 102 | ##### Project View |
| 103 | |
| 104 | Click on "Previous Reports" to check out the coverage history of the project. |
| 105 | |
| 106 | ![coverage dashboard link to previous reports] |
| 107 | |
| 108 | List of historical coverage reports are in reverse chronological order. |
| 109 | |
| 110 | ![coverage dashboard previous reports] |
| 111 | |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 112 | #### Gerrit Coverage View |
| 113 | |
| 114 | The other client supported at the moment is the gerrit plugin for code coverage. |
| 115 | |
| 116 | ![gerrit coverage view] |
| 117 | |
| 118 | See [this doc](code_coverage_in_gerrit.md) for information about the feature |
| 119 | that allows gerrit to display code coverage information generated for a given CL |
| 120 | by CQ bot. Or see this |
Roberto Carrillo | 5221fc1 | 2019-01-30 21:34:50 | [diff] [blame] | 121 | [15-second video tutorial](https://www.youtube.com/watch?v=cxXlYcSgIPE). |
Yuke Liao | d3b4627 | 2018-03-14 18:25:14 | [diff] [blame] | 122 | |
Roberto Carrillo | bc1560e | 2019-01-30 20:08:58 | [diff] [blame] | 123 | ## Local Coverage Script |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 124 | The [coverage script] automates the process described below and provides a |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 125 | one-stop service to generate code coverage reports locally in just one command. |
Yuke Liao | d3b4627 | 2018-03-14 18:25:14 | [diff] [blame] | 126 | |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 127 | This script is currently supported on Linux, Mac, iOS and ChromeOS platforms. |
| 128 | |
| 129 | Here is an example usage: |
| 130 | |
Yuke Liao | d3b4627 | 2018-03-14 18:25:14 | [diff] [blame] | 131 | ``` |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 132 | $ gn gen out/coverage \ |
Bryce Thomas | c9137cf | 2020-03-31 19:47:17 | [diff] [blame^] | 133 | --args="use_clang_coverage=true is_component_build=false |
| 134 | dcheck_always_on=true is_debug=false" |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 135 | $ python tools/code_coverage/coverage.py \ |
| 136 | crypto_unittests url_unittests \ |
| 137 | -b out/coverage -o out/report \ |
| 138 | -c 'out/coverage/crypto_unittests' \ |
| 139 | -c 'out/coverage/url_unittests --gtest_filter=URLParser.PathURL' \ |
| 140 | -f url/ -f crypto/ |
| 141 | ``` |
| 142 | The command above builds `crypto_unittests` and `url_unittests` targets and then |
Max Moroz | a5a9527 | 2018-08-31 16:20:55 | [diff] [blame] | 143 | runs them individually with their commands and arguments specified by the `-c` flag. |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 144 | For `url_unittests`, it only runs the test `URLParser.PathURL`. The coverage report |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 145 | is filtered to include only files and sub-directories under `url/` and `crypto/` |
| 146 | directories. |
| 147 | |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 148 | Aside from automating the process, this script provides visualization features to |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 149 | view code coverage breakdown by directories and by components, similar to the |
| 150 | views in the [coverage dashboard](#coverage-dashboard) above. |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 151 | |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 152 | ## Workflow |
| 153 | This section presents the workflow of generating code coverage reports using two |
| 154 | unit test targets in Chromium repo as an example: `crypto_unittests` and |
| 155 | `url_unittests`, and the following diagram shows a step-by-step overview of the |
| 156 | process. |
| 157 | |
| 158 |  |
| 159 | |
| 160 | ### Step 0 Download Tooling |
| 161 | Generating code coverage reports requires llvm-profdata and llvm-cov tools. |
| 162 | Currently, these two tools are not part of Chromium’s Clang bundle, |
| 163 | [coverage script] downloads and updates them automatically, you can also |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 164 | download the tools manually ([tools link]). |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 165 | |
| 166 | ### Step 1 Build |
| 167 | In Chromium, to compile code with coverage enabled, one needs to add |
Yuke Liao | 8c0868fe6 | 2019-10-22 21:02:33 | [diff] [blame] | 168 | `use_clang_coverage=true`, `is_component_build=false` and `is_debug=false` GN |
| 169 | flags to the args.gn file in the build output directory. Under the hood, they |
| 170 | ensure `-fprofile-instr-generate` and `-fcoverage-mapping` flags are passed to |
| 171 | the compiler. |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 172 | |
| 173 | ``` |
| 174 | $ gn gen out/coverage \ |
Yuke Liao | 8c0868fe6 | 2019-10-22 21:02:33 | [diff] [blame] | 175 | --args='use_clang_coverage=true is_component_build=false is_debug=false' |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 176 | $ gclient runhooks |
Max Moroz | f5b31fcd | 2018-08-10 21:55:48 | [diff] [blame] | 177 | $ autoninja -C out/coverage crypto_unittests url_unittests |
Yuke Liao | d3b4627 | 2018-03-14 18:25:14 | [diff] [blame] | 178 | ``` |
| 179 | |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 180 | ### Step 2 Create Raw Profiles |
Yuke Liao | bc35726b | 2018-10-31 22:16:21 | [diff] [blame] | 181 | The next step is to run the instrumented binaries. When the program exits, it |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 182 | writes a raw profile for each process. Because Chromium runs tests in |
| 183 | multiple processes, the number of processes spawned can be as many as a few |
| 184 | hundred, resulting in the generation of a few hundred gigabytes’ raw |
| 185 | profiles. To limit the number of raw profiles, `%Nm` pattern in |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 186 | `LLVM_PROFILE_FILE` environment variable is used to run tests in multi-process |
| 187 | mode, where `N` is the number of raw profiles. With `N = 4`, the total size of |
| 188 | the raw profiles are limited to a few gigabytes. |
| 189 | |
| 190 | ``` |
| 191 | $ export LLVM_PROFILE_FILE=”out/report/crypto_unittests.%4m.profraw” |
| 192 | $ ./out/coverage/crypto_unittests |
| 193 | $ ls out/report/ |
| 194 | crypto_unittests.3657994905831792357_0.profraw |
| 195 | ... |
| 196 | crypto_unittests.3657994905831792357_3.profraw |
| 197 | ``` |
| 198 | |
| 199 | ### Step 3 Create Indexed Profile |
| 200 | Raw profiles must be indexed before generating code coverage reports, and this |
| 201 | is done using the `merge` command of `llvm-profdata` tool, which merges multiple |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 202 | raw profiles (.profraw) and indexes them to create a single profile (.profdata). |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 203 | |
| 204 | At this point, all the raw profiles can be thrown away because their information |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 205 | is already contained in the indexed profile. |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 206 | |
| 207 | ``` |
| 208 | $ llvm-profdata merge -o out/report/coverage.profdata \ |
| 209 | out/report/crypto_unittests.3657994905831792357_0.profraw |
| 210 | ... |
| 211 | out/report/crypto_unittests.3657994905831792357_3.profraw |
| 212 | out/report/url_unittests.714228855822523802_0.profraw |
| 213 | ... |
| 214 | out/report/url_unittests.714228855822523802_3.profraw |
| 215 | $ ls out/report/coverage.profdata |
| 216 | out/report/coverage.profdata |
| 217 | ``` |
| 218 | |
| 219 | ### Step 4 Create Coverage Reports |
| 220 | Finally, `llvm-cov` is used to render code coverage reports. There are different |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 221 | report generation modes, and all of them require the following as input: |
| 222 | - Indexed profile |
| 223 | - All built target binaries |
Roberto Carrillo | 5221fc1 | 2019-01-30 21:34:50 | [diff] [blame] | 224 | - All exercised source files |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 225 | |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 226 | For example, the following command can be used to generate per-file line-by-line |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 227 | code coverage report: |
| 228 | |
| 229 | ``` |
| 230 | $ llvm-cov show -output-dir=out/report -format=html \ |
| 231 | -instr-profile=out/report/coverage.profdata \ |
| 232 | -object=out/coverage/url_unittests \ |
| 233 | out/coverage/crypto_unittests |
| 234 | ``` |
| 235 | |
| 236 | For more information on how to use llvm-cov, please refer to the [guide]. |
Yuke Liao | d3b4627 | 2018-03-14 18:25:14 | [diff] [blame] | 237 | |
Max Moroz | d73e45f | 2018-04-24 18:32:47 | [diff] [blame] | 238 | ## Contacts |
| 239 | |
| 240 | ### Reporting problems |
Yuke Liao | d3b4627 | 2018-03-14 18:25:14 | [diff] [blame] | 241 | For any breakage report and feature requests, please [file a bug]. |
| 242 | |
Max Moroz | d73e45f | 2018-04-24 18:32:47 | [diff] [blame] | 243 | ### Mailing list |
Yuke Liao | bc35726b | 2018-10-31 22:16:21 | [diff] [blame] | 244 | For questions and general discussions, please join [code-coverage group]. |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 245 | |
Max Moroz | d73e45f | 2018-04-24 18:32:47 | [diff] [blame] | 246 | ## FAQ |
| 247 | |
| 248 | ### Can I use `is_component_build=true` for code coverage build? |
| 249 | |
| 250 | Yes, code coverage instrumentation works with both component and non-component |
| 251 | builds. Component build is usually faster to compile, but can be up to several |
| 252 | times slower to run with code coverage instrumentation. For more information, |
Max Moroz | c5e364a | 2018-04-25 23:19:49 | [diff] [blame] | 253 | see [crbug.com/831939]. |
| 254 | |
| 255 | ### I am getting some warnings while using the script, is that fine? |
| 256 | |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 257 | Usually this is not a critical issue, but in general we tend not to have any |
Max Moroz | c5e364a | 2018-04-25 23:19:49 | [diff] [blame] | 258 | warnings. Please check the list of [known issues], and if there is a similar |
| 259 | bug, leave a comment with the command you run, the output you get, and Chromium |
Yuke Liao | 03c64407 | 2019-07-30 18:33:40 | [diff] [blame] | 260 | revision you use. Otherwise, please [file a bug] providing the same information. |
Max Moroz | c5e364a | 2018-04-25 23:19:49 | [diff] [blame] | 261 | |
| 262 | ### How do crashes affect code coverage? |
| 263 | |
Max Moroz | a5a9527 | 2018-08-31 16:20:55 | [diff] [blame] | 264 | If a crash of any type occurs (e.g. Segmentation Fault or ASan error), the |
| 265 | crashing process might not dump coverage information necessary to generate |
Max Moroz | c5e364a | 2018-04-25 23:19:49 | [diff] [blame] | 266 | code coverage report. For single-process applications (e.g. fuzz targets), that |
Max Moroz | a5a9527 | 2018-08-31 16:20:55 | [diff] [blame] | 267 | means no coverage might be reported at all. For multi-process applications, the |
| 268 | report might be incomplete. It is important to fix the crash first. If this is |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 269 | happening only in the coverage instrumented build, please [file a bug]. |
Max Moroz | d73e45f | 2018-04-24 18:32:47 | [diff] [blame] | 270 | |
Max Moroz | a5a9527 | 2018-08-31 16:20:55 | [diff] [blame] | 271 | ### How do assertions affect code coverage? |
| 272 | |
| 273 | If a crash is caused by CHECK or DCHECK, the coverage dump will still be written |
| 274 | on the disk ([crrev.com/c/1172932]). However, if a crashing process calls the |
| 275 | standard [assert] directly or through a custom wrapper, the dump will not be |
| 276 | written (see [How do crashes affect code coverage?]). |
| 277 | |
Max Moroz | 63cd04d | 2018-05-02 16:40:23 | [diff] [blame] | 278 | ### Is it possible to obtain code coverage from a full Chromium build? |
| 279 | |
| 280 | Yes, with some important caveats. It is possible to build `chrome` target with |
| 281 | code coverage instrumentation enabled. However, there are some inconveniences |
| 282 | involved: |
| 283 | |
| 284 | * Linking may take a while |
| 285 | * The binary is huge (~4GB) |
| 286 | * The browser "works", but is noticeably slow and laggy |
| 287 | * The sandbox needs to be disabled (`--no-sandbox`) |
Max Moroz | 63cd04d | 2018-05-02 16:40:23 | [diff] [blame] | 288 | |
| 289 | For more information, please see [crbug.com/834781]. |
| 290 | |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 291 | ### Why do we see significantly different coverage reported on different revisions? |
| 292 | |
| 293 | There can be two possible scenarios: |
| 294 | |
| 295 | * It can be a one time flakiness due to a broken build or failing tests. |
| 296 | * It can be caused by extension of the test suite used for generating code |
| 297 | coverage reports. When we add new tests to the suite, the aggregate coverage |
| 298 | reported usually grows after that. |
| 299 | |
| 300 | ### How can I improve [coverage dashboard]? |
| 301 | |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 302 | The code for the service and dashboard currently lives along with findit at |
| 303 | [this location](https://chromium.googlesource.com/infra/infra/+/master/appengine/findit/) |
| 304 | because of significant shared logic. |
| 305 | |
| 306 | The code used by the bots that generate the coverage data lives (among other |
| 307 | places) in the |
Yuke Liao | 04efa97 | 2019-06-26 21:14:07 | [diff] [blame] | 308 | [code coverage recipe module](https://chromium.googlesource.com/chromium/tools/build/+/master/scripts/slave/recipe_modules/code_coverage/). |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 309 | |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 310 | ### Why is coverage for X not reported or unreasonably low, even though there is a test for X? |
| 311 | |
| 312 | There are several reasons why coverage reports can be incomplete or incorrect: |
| 313 | |
| 314 | * A particular test is not used for code coverage report generation. Please |
Roberto Carrillo | 5221fc1 | 2019-01-30 21:34:50 | [diff] [blame] | 315 | [file a bug]. |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 316 | * A test may have a build failure or a runtime crash. Please check the build |
| 317 | for that particular report (rightmost column on the [coverage dashboard]). |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 318 | If there is any failure, please upload a CL with the fix. If you can't fix it, |
| 319 | feel free to [file a bug]. |
| 320 | * A particular test may not be available on a particular platform. As of now, |
Yuke Liao | 43bbbcd5 | 2019-06-21 19:34:50 | [diff] [blame] | 321 | only reports generated on Linux and CrOS are available on the |
| 322 | [coverage dashboard]. |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 323 | |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 324 | ### Is coverage reported for the code executed inside the sandbox? |
| 325 | |
Yuke Liao | 8c0868fe6 | 2019-10-22 21:02:33 | [diff] [blame] | 326 | Yes! |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 327 | |
Max Moroz | d73e45f | 2018-04-24 18:32:47 | [diff] [blame] | 328 | |
Max Moroz | a5a9527 | 2018-08-31 16:20:55 | [diff] [blame] | 329 | [assert]: http://man7.org/linux/man-pages/man3/assert.3.html |
Yuke Liao | bc35726b | 2018-10-31 22:16:21 | [diff] [blame] | 330 | [code-coverage group]: https://groups.google.com/a/chromium.org/forum/#!forum/code-coverage |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 331 | [code-coverage repository]: https://chrome-internal.googlesource.com/chrome/tools/code-coverage |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 332 | [coverage dashboard]: https://analysis.chromium.org/p/chromium/coverage |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 333 | [coverage script]: https://cs.chromium.org/chromium/src/tools/code_coverage/coverage.py |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 334 | [coverage infra diagram]: images/code_coverage_infra_diagram.png |
| 335 | [coverage dashboard file view]: images/code_coverage_dashboard_file_view.png |
| 336 | [coverage dashboard component view]: images/code_coverage_dashboard_component_view.png |
| 337 | [coverage dashboard directory view]: images/code_coverage_dashboard_directory_view.png |
Yuke Liao | 43bbbcd5 | 2019-06-21 19:34:50 | [diff] [blame] | 338 | [coverage dashboard link to previous reports]: images/code_coverage_dashboard_link_to_previous_reports.png |
| 339 | [coverage dashboard previous reports]: images/code_coverage_dashboard_previous_reports.png |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 340 | [crbug.com/821617]: https://crbug.com/821617 |
Max Moroz | c5e364a | 2018-04-25 23:19:49 | [diff] [blame] | 341 | [crbug.com/831939]: https://crbug.com/831939 |
Max Moroz | 63cd04d | 2018-05-02 16:40:23 | [diff] [blame] | 342 | [crbug.com/834781]: https://crbug.com/834781 |
Max Moroz | a5a9527 | 2018-08-31 16:20:55 | [diff] [blame] | 343 | [crrev.com/c/1172932]: https://crrev.com/c/1172932 |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 344 | [clang roll]: https://crbug.com/841908 |
Abhishek Arya | b23b1a7 | 2018-05-17 20:11:09 | [diff] [blame] | 345 | [dead code example]: https://chromium.googlesource.com/chromium/src/+/ac6e09311fcc7e734be2ef21a9ccbbe04c4c4706 |
Max Moroz | c5e364a | 2018-04-25 23:19:49 | [diff] [blame] | 346 | [documentation]: https://clang.llvm.org/docs/SourceBasedCodeCoverage.html |
Yuke Liao | 03c64407 | 2019-07-30 18:33:40 | [diff] [blame] | 347 | [file a bug]: https://bugs.chromium.org/p/chromium/issues/entry?components=Infra%3ETest%3ECodeCoverage |
Yuke Liao | 43bbbcd5 | 2019-06-21 19:34:50 | [diff] [blame] | 348 | [gerrit coverage view]: images/code_coverage_annotations.png |
Max Moroz | c5e364a | 2018-04-25 23:19:49 | [diff] [blame] | 349 | [guide]: http://llvm.org/docs/CommandGuide/llvm-cov.html |
Max Moroz | a5a9527 | 2018-08-31 16:20:55 | [diff] [blame] | 350 | [How do crashes affect code coverage?]: #how-do-crashes-affect-code-coverage |
Yuke Liao | 03c64407 | 2019-07-30 18:33:40 | [diff] [blame] | 351 | [known issues]: https://bugs.chromium.org/p/chromium/issues/list?q=component:Infra%3ETest%3ECodeCoverage |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 352 | [tools link]: https://storage.googleapis.com/chromium-browser-clang-staging/ |