RConsortium / wishlist

A wishlist of idea from the ISC and community
29 stars 0 forks source link

Code coverage of R itself #9

Open HenrikBengtsson opened 7 years ago

HenrikBengtsson commented 7 years ago

Doing code coverage analysis on the R source code would:

The covr package should be useful for this. It is not obvious to me how to run covr on the core R packages since they're not standalone packages per se, e.g.

> c <- covr::package_coverage(quiet = FALSE)
Error: '[...]/r-source/src/library/stats' does not contain a package!
jimhester commented 7 years ago

I agree this could be very useful, e.g. rho tracks C/C++ coverage for instance.

Tracking the R code with covr is a little tricky though, many of the tests in base R are not in the individual packages themselves, but in the https://github.com/wch/r-source/tree/trunk/tests directory, the packages (particuarly the base package) uses different methods to load than a user package and covr obviously uses base functions when it runs, which may muddle the counts.