talira

Test Coverage for Packages

open sourceMITfree

covr tracks test coverage for an R package and reports it locally (a line-by-line HTML report, a summary in the console) or uploads it to Codecov or Coveralls. It measures the package's R code and its compiled C, C++, Fortran and Rust code together in one report, works with any testing framework, and can write a Cobertura XML file for other tools. usethis sets up a GitHub Actions workflow that runs it on every push.

Problems it solves

  • find out which lines of my R package my tests never run
  • measure coverage of the C++ code in my R package alongside the R code
  • upload my R package's test coverage to Codecov from GitHub Actions
  • see a line-by-line coverage report for an R package in the browser
  • export R test coverage as Cobertura XML for my CI tools

Features

  • coverage of R code and compiled C, C++, Fortran and Rust code
  • local HTML and console reports
  • upload to Codecov or Coveralls
  • Cobertura XML output
  • works with any testing framework
  • GitHub Actions setup through usethis

Alternatives

The same job

These do what covr does.

  1. Codecov More than just code coverage.
  2. Coveralls We help you deliver code confidently by showing which parts of your code aren't covered by tests.
  3. pytest-cov Pytest plugin for measuring coverage

Compare covr with the top 3