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 \ |
Max Moroz | a5a9527 | 2018-08-31 16:20:55 | [diff] [blame] | 133 | --args='use_clang_coverage=true is_component_build=false dcheck_always_on=true' |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 134 | $ python tools/code_coverage/coverage.py \ |
| 135 | crypto_unittests url_unittests \ |
| 136 | -b out/coverage -o out/report \ |
| 137 | -c 'out/coverage/crypto_unittests' \ |
| 138 | -c 'out/coverage/url_unittests --gtest_filter=URLParser.PathURL' \ |
| 139 | -f url/ -f crypto/ |
| 140 | ``` |
| 141 | The command above builds `crypto_unittests` and `url_unittests` targets and then |
Max Moroz | a5a9527 | 2018-08-31 16:20:55 | [diff] [blame] | 142 | runs them individually with their commands and arguments specified by the `-c` flag. |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 143 | For `url_unittests`, it only runs the test `URLParser.PathURL`. The coverage report |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 144 | is filtered to include only files and sub-directories under `url/` and `crypto/` |
| 145 | directories. |
| 146 | |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 147 | Aside from automating the process, this script provides visualization features to |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 148 | view code coverage breakdown by directories and by components, similar to the |
| 149 | views in the [coverage dashboard](#coverage-dashboard) above. |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 150 | |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 151 | ## Workflow |
| 152 | This section presents the workflow of generating code coverage reports using two |
| 153 | unit test targets in Chromium repo as an example: `crypto_unittests` and |
| 154 | `url_unittests`, and the following diagram shows a step-by-step overview of the |
| 155 | process. |
| 156 | |
| 157 |  |
| 158 | |
| 159 | ### Step 0 Download Tooling |
| 160 | Generating code coverage reports requires llvm-profdata and llvm-cov tools. |
| 161 | Currently, these two tools are not part of Chromium’s Clang bundle, |
| 162 | [coverage script] downloads and updates them automatically, you can also |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 163 | download the tools manually ([tools link]). |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 164 | |
| 165 | ### Step 1 Build |
| 166 | In Chromium, to compile code with coverage enabled, one needs to add |
| 167 | `use_clang_coverage=true` and `is_component_build=false` GN flags to the args.gn |
| 168 | file in the build output directory. Under the hood, they ensure |
| 169 | `-fprofile-instr-generate` and `-fcoverage-mapping` flags are passed to the |
| 170 | compiler. |
| 171 | |
| 172 | ``` |
| 173 | $ gn gen out/coverage \ |
| 174 | --args='use_clang_coverage=true is_component_build=false' |
| 175 | $ gclient runhooks |
Max Moroz | f5b31fcd | 2018-08-10 21:55:48 | [diff] [blame] | 176 | $ autoninja -C out/coverage crypto_unittests url_unittests |
Yuke Liao | d3b4627 | 2018-03-14 18:25:14 | [diff] [blame] | 177 | ``` |
| 178 | |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 179 | ### Step 2 Create Raw Profiles |
Yuke Liao | bc35726b | 2018-10-31 22:16:21 | [diff] [blame] | 180 | 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] | 181 | writes a raw profile for each process. Because Chromium runs tests in |
| 182 | multiple processes, the number of processes spawned can be as many as a few |
| 183 | hundred, resulting in the generation of a few hundred gigabytes’ raw |
| 184 | profiles. To limit the number of raw profiles, `%Nm` pattern in |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 185 | `LLVM_PROFILE_FILE` environment variable is used to run tests in multi-process |
| 186 | mode, where `N` is the number of raw profiles. With `N = 4`, the total size of |
| 187 | the raw profiles are limited to a few gigabytes. |
| 188 | |
| 189 | ``` |
| 190 | $ export LLVM_PROFILE_FILE=”out/report/crypto_unittests.%4m.profraw” |
| 191 | $ ./out/coverage/crypto_unittests |
| 192 | $ ls out/report/ |
| 193 | crypto_unittests.3657994905831792357_0.profraw |
| 194 | ... |
| 195 | crypto_unittests.3657994905831792357_3.profraw |
| 196 | ``` |
| 197 | |
| 198 | ### Step 3 Create Indexed Profile |
| 199 | Raw profiles must be indexed before generating code coverage reports, and this |
| 200 | is done using the `merge` command of `llvm-profdata` tool, which merges multiple |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 201 | raw profiles (.profraw) and indexes them to create a single profile (.profdata). |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 202 | |
| 203 | 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] | 204 | is already contained in the indexed profile. |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 205 | |
| 206 | ``` |
| 207 | $ llvm-profdata merge -o out/report/coverage.profdata \ |
| 208 | out/report/crypto_unittests.3657994905831792357_0.profraw |
| 209 | ... |
| 210 | out/report/crypto_unittests.3657994905831792357_3.profraw |
| 211 | out/report/url_unittests.714228855822523802_0.profraw |
| 212 | ... |
| 213 | out/report/url_unittests.714228855822523802_3.profraw |
| 214 | $ ls out/report/coverage.profdata |
| 215 | out/report/coverage.profdata |
| 216 | ``` |
| 217 | |
| 218 | ### Step 4 Create Coverage Reports |
| 219 | Finally, `llvm-cov` is used to render code coverage reports. There are different |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 220 | report generation modes, and all of them require the following as input: |
| 221 | - Indexed profile |
| 222 | - All built target binaries |
Roberto Carrillo | 5221fc1 | 2019-01-30 21:34:50 | [diff] [blame] | 223 | - All exercised source files |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 224 | |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 225 | 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] | 226 | code coverage report: |
| 227 | |
| 228 | ``` |
| 229 | $ llvm-cov show -output-dir=out/report -format=html \ |
| 230 | -instr-profile=out/report/coverage.profdata \ |
| 231 | -object=out/coverage/url_unittests \ |
| 232 | out/coverage/crypto_unittests |
| 233 | ``` |
| 234 | |
| 235 | 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] | 236 | |
Max Moroz | d73e45f | 2018-04-24 18:32:47 | [diff] [blame] | 237 | ## Contacts |
| 238 | |
| 239 | ### Reporting problems |
Yuke Liao | d3b4627 | 2018-03-14 18:25:14 | [diff] [blame] | 240 | For any breakage report and feature requests, please [file a bug]. |
| 241 | |
Max Moroz | d73e45f | 2018-04-24 18:32:47 | [diff] [blame] | 242 | ### Mailing list |
Yuke Liao | bc35726b | 2018-10-31 22:16:21 | [diff] [blame] | 243 | For questions and general discussions, please join [code-coverage group]. |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 244 | |
Max Moroz | d73e45f | 2018-04-24 18:32:47 | [diff] [blame] | 245 | ## FAQ |
| 246 | |
| 247 | ### Can I use `is_component_build=true` for code coverage build? |
| 248 | |
| 249 | Yes, code coverage instrumentation works with both component and non-component |
| 250 | builds. Component build is usually faster to compile, but can be up to several |
| 251 | times slower to run with code coverage instrumentation. For more information, |
Max Moroz | c5e364a | 2018-04-25 23:19:49 | [diff] [blame] | 252 | see [crbug.com/831939]. |
| 253 | |
| 254 | ### I am getting some warnings while using the script, is that fine? |
| 255 | |
Abhishek Arya | af9811f2 | 2018-05-11 22:17:48 | [diff] [blame] | 256 | 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] | 257 | warnings. Please check the list of [known issues], and if there is a similar |
| 258 | 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^] | 259 | revision you use. Otherwise, please [file a bug] providing the same information. |
Max Moroz | c5e364a | 2018-04-25 23:19:49 | [diff] [blame] | 260 | |
| 261 | ### How do crashes affect code coverage? |
| 262 | |
Max Moroz | a5a9527 | 2018-08-31 16:20:55 | [diff] [blame] | 263 | If a crash of any type occurs (e.g. Segmentation Fault or ASan error), the |
| 264 | crashing process might not dump coverage information necessary to generate |
Max Moroz | c5e364a | 2018-04-25 23:19:49 | [diff] [blame] | 265 | code coverage report. For single-process applications (e.g. fuzz targets), that |
Max Moroz | a5a9527 | 2018-08-31 16:20:55 | [diff] [blame] | 266 | means no coverage might be reported at all. For multi-process applications, the |
| 267 | 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] | 268 | happening only in the coverage instrumented build, please [file a bug]. |
Max Moroz | d73e45f | 2018-04-24 18:32:47 | [diff] [blame] | 269 | |
Max Moroz | a5a9527 | 2018-08-31 16:20:55 | [diff] [blame] | 270 | ### How do assertions affect code coverage? |
| 271 | |
| 272 | If a crash is caused by CHECK or DCHECK, the coverage dump will still be written |
| 273 | on the disk ([crrev.com/c/1172932]). However, if a crashing process calls the |
| 274 | standard [assert] directly or through a custom wrapper, the dump will not be |
| 275 | written (see [How do crashes affect code coverage?]). |
| 276 | |
Max Moroz | 63cd04d | 2018-05-02 16:40:23 | [diff] [blame] | 277 | ### Is it possible to obtain code coverage from a full Chromium build? |
| 278 | |
| 279 | Yes, with some important caveats. It is possible to build `chrome` target with |
| 280 | code coverage instrumentation enabled. However, there are some inconveniences |
| 281 | involved: |
| 282 | |
| 283 | * Linking may take a while |
| 284 | * The binary is huge (~4GB) |
| 285 | * The browser "works", but is noticeably slow and laggy |
| 286 | * The sandbox needs to be disabled (`--no-sandbox`) |
Max Moroz | 63cd04d | 2018-05-02 16:40:23 | [diff] [blame] | 287 | |
| 288 | For more information, please see [crbug.com/834781]. |
| 289 | |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 290 | ### Why do we see significantly different coverage reported on different revisions? |
| 291 | |
| 292 | There can be two possible scenarios: |
| 293 | |
| 294 | * It can be a one time flakiness due to a broken build or failing tests. |
| 295 | * It can be caused by extension of the test suite used for generating code |
| 296 | coverage reports. When we add new tests to the suite, the aggregate coverage |
| 297 | reported usually grows after that. |
| 298 | |
| 299 | ### How can I improve [coverage dashboard]? |
| 300 | |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 301 | The code for the service and dashboard currently lives along with findit at |
| 302 | [this location](https://chromium.googlesource.com/infra/infra/+/master/appengine/findit/) |
| 303 | because of significant shared logic. |
| 304 | |
| 305 | The code used by the bots that generate the coverage data lives (among other |
| 306 | places) in the |
Yuke Liao | 04efa97 | 2019-06-26 21:14:07 | [diff] [blame] | 307 | [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] | 308 | |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 309 | ### Why is coverage for X not reported or unreasonably low, even though there is a test for X? |
| 310 | |
| 311 | There are several reasons why coverage reports can be incomplete or incorrect: |
| 312 | |
| 313 | * A particular test is not used for code coverage report generation. Please |
Roberto Carrillo | 5221fc1 | 2019-01-30 21:34:50 | [diff] [blame] | 314 | [file a bug]. |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 315 | * A test may have a build failure or a runtime crash. Please check the build |
| 316 | for that particular report (rightmost column on the [coverage dashboard]). |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 317 | If there is any failure, please upload a CL with the fix. If you can't fix it, |
| 318 | feel free to [file a bug]. |
| 319 | * 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] | 320 | only reports generated on Linux and CrOS are available on the |
| 321 | [coverage dashboard]. |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 322 | |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 323 | ### Is coverage reported for the code executed inside the sandbox? |
| 324 | |
| 325 | Not at the moment until [crbug.com/842424] is resolved. We do not disable the |
| 326 | sandbox when running the tests. However, if there are any other non-sandbox'ed |
| 327 | tests for the same code, the coverage should be reported from those. For more |
| 328 | information, see [crbug.com/842424]. |
| 329 | |
Max Moroz | d73e45f | 2018-04-24 18:32:47 | [diff] [blame] | 330 | |
Max Moroz | a5a9527 | 2018-08-31 16:20:55 | [diff] [blame] | 331 | [assert]: http://man7.org/linux/man-pages/man3/assert.3.html |
Yuke Liao | bc35726b | 2018-10-31 22:16:21 | [diff] [blame] | 332 | [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] | 333 | [code-coverage repository]: https://chrome-internal.googlesource.com/chrome/tools/code-coverage |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 334 | [coverage dashboard]: https://analysis.chromium.org/p/chromium/coverage |
Yuke Liao | 1ffc8cb6 | 2018-04-06 19:09:07 | [diff] [blame] | 335 | [coverage script]: https://cs.chromium.org/chromium/src/tools/code_coverage/coverage.py |
Roberto Carrillo | 3b56786 | 2019-01-30 19:01:25 | [diff] [blame] | 336 | [coverage infra diagram]: images/code_coverage_infra_diagram.png |
| 337 | [coverage dashboard file view]: images/code_coverage_dashboard_file_view.png |
| 338 | [coverage dashboard component view]: images/code_coverage_dashboard_component_view.png |
| 339 | [coverage dashboard directory view]: images/code_coverage_dashboard_directory_view.png |
Yuke Liao | 43bbbcd5 | 2019-06-21 19:34:50 | [diff] [blame] | 340 | [coverage dashboard link to previous reports]: images/code_coverage_dashboard_link_to_previous_reports.png |
| 341 | [coverage dashboard previous reports]: images/code_coverage_dashboard_previous_reports.png |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 342 | [crbug.com/821617]: https://crbug.com/821617 |
Max Moroz | c5e364a | 2018-04-25 23:19:49 | [diff] [blame] | 343 | [crbug.com/831939]: https://crbug.com/831939 |
Max Moroz | 63cd04d | 2018-05-02 16:40:23 | [diff] [blame] | 344 | [crbug.com/834781]: https://crbug.com/834781 |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 345 | [crbug.com/842424]: https://crbug.com/842424 |
Max Moroz | a5a9527 | 2018-08-31 16:20:55 | [diff] [blame] | 346 | [crrev.com/c/1172932]: https://crrev.com/c/1172932 |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 347 | [clang roll]: https://crbug.com/841908 |
Abhishek Arya | b23b1a7 | 2018-05-17 20:11:09 | [diff] [blame] | 348 | [dead code example]: https://chromium.googlesource.com/chromium/src/+/ac6e09311fcc7e734be2ef21a9ccbbe04c4c4706 |
Max Moroz | c5e364a | 2018-04-25 23:19:49 | [diff] [blame] | 349 | [documentation]: https://clang.llvm.org/docs/SourceBasedCodeCoverage.html |
Yuke Liao | 03c64407 | 2019-07-30 18:33:40 | [diff] [blame^] | 350 | [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] | 351 | [gerrit coverage view]: images/code_coverage_annotations.png |
Max Moroz | c5e364a | 2018-04-25 23:19:49 | [diff] [blame] | 352 | [guide]: http://llvm.org/docs/CommandGuide/llvm-cov.html |
Max Moroz | a5a9527 | 2018-08-31 16:20:55 | [diff] [blame] | 353 | [How do crashes affect code coverage?]: #how-do-crashes-affect-code-coverage |
Yuke Liao | 03c64407 | 2019-07-30 18:33:40 | [diff] [blame^] | 354 | [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] | 355 | [tools link]: https://storage.googleapis.com/chromium-browser-clang-staging/ |
Max Moroz | 3a92890 | 2018-05-15 14:39:50 | [diff] [blame] | 356 | [test suite]: https://cs.chromium.org/chromium/src/tools/code_coverage/test_suite.txt |