h_covr_helpers | R Documentation |
covr
-inserted trace codeWorkarounds to allow the package to continue to work while running covr
with minimal changes to the package code.
h_covr_active()
h_covr_detrace(expr)
h_is_covr_trace(expr)
h_covr_detrace_call(expr)
expr |
( |
When using covr
, the source code for package objects are modified to add
callbacks for each expression to log its execution. Given an arbitrary
expression, such as:
expr
The code will be modified before executing any package code to look like:
if (TRUE) { covr:::count("file.R:1:2:3:4:5:6:7:8") expr }
These functions are used for stripping expressions of this code so that the
package continues to work as intended while running tests as part of running
covr
to calculate package coverage.
This method is non-exhaustive, covering only a subset of covr
's tracing
behaviors necessary for this package.
A logical value or transformed expression with calls to
covr:::count
removed.
h_covr_active()
: Determine whether covr
is currently running
h_covr_detrace()
: Remove covr
traces from an expression
h_is_covr_trace()
: Determine whether the current expression is a covr
-modified expression
h_covr_detrace_call()
: Extract the original expression from a covr
-modified expression
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.