Home

Awesome

bazel-coverage-report

Not maintained: Please look at forks instead!

Build Status

bazel-coverage-report is a multi-language coverage report generator for Bazel. It is based on genhtml.

See the example report generated for the //test/... targets.

Bug reports and feature requests are welcome.

Usage

In your WORKSPACE:

git_repository(
    name = "hchauvin_bazel_coverage_report",
    remote = "https://github.com/hchauvin/bazel-coverage-report.git",
    commit = "{HEAD}",
)
load("@hchauvin_bazel_coverage_report//report:defs.bzl", "bazel_coverage_report_repositories")
bazel_coverage_report_repositories()  # lcov, ...

Then:

  1. Generate coverage data with bazel coverage //your/targets/... --instrumentation_filter=<...>
  2. Build the coverage report generator: bazel build @hchauvin_bazel_coverage_report//report:bin
  3. Generate the report: bazel-bin/external/hchauvin_bazel_coverage_report/report/bin --dest_dir=<dest dir>

Supported languages

See ./WORKSPACE for the version of the rules that are supported. Some of these versions are pending Push Requests.