Track and report test coverage for R packages with local reports and optional CI integration.
covr is an R package that tracks and reports test coverage for R packages. It instruments package code to record which lines are executed during tests and generates detailed coverage reports to help developers identify untested code. The tool integrates with local development workflows and CI services to maintain code quality.
R package developers who want to measure and improve their test coverage, particularly those using testthat or other testing frameworks and integrating with CI/CD pipelines.
covr provides a seamless, integrated solution for test coverage in R with features like RStudio Addins, flexible exclusion options, and support for compiled code, making it the go-to tool for comprehensive coverage analysis in the R ecosystem.
Test coverage reports for R
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports multiple exclusion methods via .covrignore files, function patterns, and inline comments, allowing precise control over coverage calculations without modifying test code.
Includes an RStudio Addin for one-click coverage reports with customizable keyboard shortcuts, making it easy to access interactive HTML reports during local development.
Works with any testing package like testthat or RUnit via tools::testInstalledPackage(), ensuring it fits into existing testing workflows without requiring changes.
Tracks coverage for C/C++ code with gcc, clang, and Intel icc compilers, providing insights into both R and compiled language test coverage when configured properly.
Cannot be run during standard R CMD check due to code modification that may affect behavior and compilation without optimization, limiting its use in official package validation workflows.
Instruments package code to track line execution, which can slow down test runs and add computational overhead, especially for large packages or extensive test suites.
Requires specific compiler versions and gcov setup; if gcov is not on the path, manual configuration via options(covr.gcov) is needed, adding steps for non-standard environments.