RepositoryR
r-lib

r-lib/covr

Test coverage reports for R

350stars
123forks
1issues
5views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: codecov

#1 Repository of the day

1
TINIX TRENDING·Topic: coverage

#1 Repository of the day

1
TINIX TRENDING·Topic: coverage-report

#1 Repository of the day

📊 Test coverage reports for R packages, right where you work

Track what your R tests actually hit — locally, in RStudio, or in CI.

covr, from the r-lib team, measures test coverage for R packages. Run it locally to inspect coverage line by line, or upload results to codecov or coveralls. Install from CRAN with install.packages("covr"), and set up GitHub Actions coverage quickly with usethis::use_github_action("test-coverage").

✨ Highlights

  • Local coverage reports: Call report() to inspect coverage for each line in your package (requires the DT package).
  • RStudio Addin: Run report() on the active project from the Addin menu or bind it to a shortcut (e.g., Ctrl-Shift-C).
  • Interactive API: Use package_coverage() (current directory or another path), view results with as.data.frame(cov), and find gaps with zero_coverage(cov) (opens a marker pane in RStudio).
  • File and directory exclusions: Add a .covrignore file in the package root (glob rules via Sys.glob()); location can be set via COVR_COVRIGNORE or the covr.covrignore option.
  • Function and line exclusions: Exclude by name with function_exclusions (regex), or by file/ranges with line_exclusions.
  • In-source exclusion comments: Mark lines with # nocov, or ranges with # nocov start / # nocov end (patterns configurable via covr.exclude_pattern, covr.exclude_start, covr.exclude_end).
  • Works with common test frameworks: Compatible with any testing package; covr uses tools::testInstalledPackage() to run package tests.
  • Compiled code support: Supports Intel's icc, clang 3.5+, and gcc 4.2+; configure covr.gcov (set to "" to turn off compiled-code coverage).

💡 Why it matters

Coverage is most useful when it fits into everyday development, not just CI. covr makes that practical for R packages: generate an interactive report, jump to uncovered lines with zero_coverage(), and keep noisy or intentional gaps out of the numbers using .covrignore, targeted exclusions, or # nocov comments.

Under the hood, covr tracks coverage by modifying a package's code to add tracking calls to each call (see the vignettes/how_it_works.Rmd vignette). The README notes it is not intended to run during R CMD check, since code modification and compiling without optimization for compiled-code coverage can affect behavior.


#R #TestCoverage #Codecov #OpenSource #TiniX

Similar Projects

Discover other similar projects and AI models.

RepositoryC++
SimonKagstrom/kcov

Code coverage tool for compiled programs, Python and Bash which uses debugging information to collect and report data without special compilation options

842
Nov 28, 2026
RepositoryPython
codecov/codecov-python

Python report uploader for Codecov

185
May 21, 2025
RepositoryRuby
simplecov-ruby/simplecov

Code coverage for Ruby with a powerful configuration library and automatic merging of coverage across test suites

4.9k
Dec 1, 2026
RepositoryPython
gcovr/gcovr

Generate code coverage reports with gcc/gcov

1.0k
Dec 1, 2026
RepositoryRuby
fastlane-community/xcov

Nice code coverage reporting without hassle

573
Nov 24, 2026
RepositoryTypeScript
alexcanessa/typescript-coverage-report

Node command tool to generate TypeScript coverage report

524
Nov 1, 2026
RepositoryRuby
messeb/ios-project-template

iOS project template with fastlane lanes, Travis CI jobs and GitHub integrations of Codecov, HoundCI for SwiftLint and Danger

409
Jan 9, 2023
RepositoryJavaScript
codecov/codecov-node

Global coverage report uploader for Codecov in NodeJS

291
Jan 6, 2023
RepositoryJulia
JuliaCI/Coverage.jl

Take Julia code coverage and memory allocation results, do useful things with them

183
Nov 12, 2026