covr tracks and reports 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.
A coverage report can be used to inspect coverage for each line in your
report() requires the additional dependencies
# If run with no arguments `report()` implicitly calls `package_coverage()` report()
covr uses the following
options() to configure behaviour:
covr.covrignore: A filename to use as an ignore file,
listing glob-style wildcarded paths of files to ignore for coverage
calculations. Defaults to the value of environment variable
".covrignore" if the neither the option nor the
environment variable are set.
covr.exclude_end: Used along with
covr.exclude_start, an optional
regular expression which ends a line-exclusion region. For more
covr.exclude_pattern: An optional line-exclusion pattern. Lines
which match the pattern will be excluded from coverage. For more details,
covr.exclude_start: Used along with
covr.exclude_end, an optional
regular expression which starts a line-exclusion region. For more
TRUE (the default behavior), coverage
of files outside the target package are filtered from coverage output.
covr.gcov: If the appropriate gcov version is not on your path you
can use this option to set the appropriate location. If set to "" it will
turn off coverage of compiled code.
covr.rstudio_source_markers: A logical value. If
default behavior), source markers are displayed within the RStudio IDE
NULL), record a listing of
top level test expressions and associate tests with
evaluated during the test's execution. For more details, see