covrTraceCPOs: Add 'covr' coverage to CPOs

View source: R/auxiliary.R

covrTraceCPOsR Documentation

Add 'covr' coverage to CPOs


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


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)



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


Trace CPO functions even when R_COVR is not “true”. Default is FALSE.



mlrCPO documentation built on Nov. 18, 2022, 1:05 a.m.