Evaluating Code Coverage

Mircea Trofin edited this page Jun 27, 2017 · 3 revisions

You are working on a change. You want to evaluate code coverage for your new code.

V8 provides 2 tools for doing this - local, on your machine; and build infrastructure support.


Relative to the root of the v8 repo, use ./tools/gcov.sh (tested on linux). This will use gnu's code coverage tooling and some scripting to produce a html report, where you can drill down coverage info per directory, file, and then down to line of code.

The script will build v8 under a separate out directory, using gcov settings. We use a separate directory to avoid clobbering your normal build settings. This separate directory is called cov - it is created immediately under the repo root. gcov.sh will then run the test suite, and produce the report. The path to the report is provided when the script completes.

If your change has architecture specific components, you can cumulatively collect coverage from architecture specific runs.

./tools/gcov.sh x64 arm

This will in-place rebuild for each architecture, clobbering the binaries from the previous run, but preserving and accumulating over the coverage results.

By default, the script collects from Release runs. If you want Debug, you may specify so:

BUILD_TYPE=Debug ./tools/gcov.sh x64 arm arm64

Running the script with no options will provide a summary of options as well.

Code Coverage Bot

For each change that landed, we run a x64 coverage analysis - see the coverage bot. We don't run bots for coverage for other architectures.

To get the report for a particular run, you want to list the build steps, find the "gsutil coverage report" one (towards the end), and open the "report" under it.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.