Use this if you want to check code coverage of CPOs using covr. The functions inside CPOs is originally not accessible to covr, so covrTraceCPOs needs to be called in the .onAttach function. Note that putting it in .onLoad will not work.

Currently, for this to work, the mb706 fork of covr needs to be used. To install it, call

devtools::install_github("mb706/covr")

To use it on Travis CI, add the line - mb706/covr under the r_github_packages: category.

This function comes at no runtime penalty: If the R_COVR environment variable is not set to “true”, then it only has an effect if force is TRUE.

covrTraceCPOs(env = parent.env(parent.frame()), force = FALSE)

Arguments

env

[environment]
The environment to search for CPOs. Default is parent.env(parent.frame()), which is the package namespace if called from .onLoad.

force

[logical(1)]
Trace CPO functions even when R_COVR is not “true”. Default is FALSE.

Value

[invisible(NULL)].