Test Coverage for Packages
Overview
Track and report code coverage for your package and (optionally) upload the results to a coverage service like 'Codecov' https://about.codecov.io or 'Coveralls' https://coveralls.io. Code coverage is a measure of the amount of code being exercised by a set of tests. It is an indirect measure of test quality and completeness. This package is compatible with any testing methodology or framework and tracks coverage of both R code and compiled C/C++/FORTRAN code.
New Features and improvements
- Added support for
klmr/boxmodules. This works best withfile_coverage(). (@radbasa, #491) - Performance improvement for compiled code with a lot of compilation units (@krlmlr, #611)
- Fix R CMD check NOTE for upcoming R 4.6: non-API calls to SET_BODY, SET_CLOENV, SET_FORMALS (@t-kalinowski, #587)
Fixes and minor improvements
- Messages are now displayed using cli instead of crayon (@olivroy, #591).
- covr now uses
testthat::with_mocked_bindings()for its internal testing (@olivroy, #595). - Fix a bug preventing
package_coverage()from running tests wheninstall_pathis set to a relative path (@gergness, #517, #548). - Fixed a performance regression and an error triggered by a change in R 4.4.0. (@kyleam, #588)
- Fixed an issue where attempting to generate code coverage on an already-loaded package could fail on Windows. (@kevinushey, #574)
Show all changes in 3.6.5Hide the rest of the changes in 3.6.5
- Prevent
covr.record_testsoption from logging duplicate tests when the same line of testing code is hit repeatedly, as in a loop. (@dgkf, #528) - Normalize
install_pathpath before creating directory to prevent failures when running covr in a subprocess using a path with Windows\\path separators. (@maksymiuks, #592)
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 43 (12 internal)includes a package overview page
- Examples that run
- 63%5 run in a plain check · 3 never run
- Exported functions with examples
- 30%
- Documented parameters
- 95%
- Return-value docs
- 20%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 78%
- Median days to close, 50 most recently updated closed issues
- 16
- Median days to close, 50 most recently updated closed PRs
- 10
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
14 development-tooling and community-health practices detected across 8 families in the upstream repository
Checks run against github.com/r-lib/covr on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-10-09 · The repository has a site deploy workflow
pkgdown site last built 2023-11-08, before release 3.6.5 (2025-11-09)
Show all practicesHide 4 practices
Dependencies
Installing covr adds 13 packages (9 with compiled code, 4.1 MB of source tarballs). Heaviest: openssl 1.1 MB, jsonlite 1.0 MB, curl 714 KB.
Show the 48 most downloaded packagesHide the 48 most downloaded packages
Code & Tests
People & History
Show 18 more contributorsHide 18 contributors
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 3.6.5Latest
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 3.6.42023-11-09 · diff ↗
- 3.6.32023-10-11 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 3.6.22023-03-25 · diff ↗
- 3.6.12022-08-26 · diff ↗
- 3.6.02022-08-24 · diff ↗
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 3.5.12020-09-16 · diff ↗
- RR 4.0.0 released · 2020-04-24
- 3.5.0
- 3.4.0
Show 20 earlier eventsHide 20 earlier events
- 3.3.22019-10-16 · diff ↗
- 3.3.12019-08-23 · diff ↗
- 3.3.0
- RR 3.6.0 released · 2019-04-26
- 3.2.12018-10-18 · diff ↗
- 3.2.02018-09-21 · diff ↗ ·
removed 1 export
shineadded 4 exports
display_name, environment_coverage, file_report, gitlab - 3.1.0
- RR 3.5.0 released · 2018-04-23
- 3.0.12017-11-08 · diff ↗
- 3.0.02017-06-26 · diff ↗
- RR 3.4.0 released · 2017-04-21
- 2.2.2
- 2.2.12016-12-05 · diff ↗
- 2.2.0
- 2.1.0
- RR 3.3.0 released · 2016-05-03
- 2.0.12016-04-06 · diff ↗ ·
removed 4 exports
display_name<-, display_name, environment_coverage, environment_coverage_ - 1.2.02015-06-25 · diff ↗
- 1.0.02015-05-20
- RR 3.2.0 released · 2015-04-16
Package metadata
- First published
- 2015-05-20
- Total releases
- 24 / 11 yrs
- License
- MIT + file LICENSE OSI · relicensed from GPL-3 in 3.6.0
- Minimum R
- ≥ 3.1.0
- Download size
- 170 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("covr")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-19, which the citation names so these numbers can be found later. More on citing and the projects behind them.