
Helpers for stripping expressions of covr-inserted trace code
Source: R/helpers_covr.R
h_covr_helpers.RdWorkarounds to allow the package to continue to work while running covr
with minimal changes to the package code.
Details
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:
The code will be modified before executing any package code to look like:
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.
Functions
h_covr_active(): Determine whethercovris currently runningh_covr_detrace(): Removecovrtraces from an expressionh_is_covr_trace(): Determine whether the current expression is acovr-modified expressionh_covr_detrace_call(): Extract the original expression from acovr-modified expression