Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github test-coverage workflow does not ignore an Rcpp auto-generated header file inst/include/<pkg_name>_RcppExports.h #531

Open
zhuxr11 opened this issue Apr 29, 2023 · 0 comments

Comments

@zhuxr11
Copy link

zhuxr11 commented Apr 29, 2023

Hi, recently I exported some Rcpp functions from a package to R and cpp interfaces using // [[Rcpp:interfaces(r, cpp)]] attribute. When I pushed the changes to Github, the test-coverage workflow began to test coverage on an auto-generated file (by Rcpp) inst/include/<pkg_name>_RcppExports.h. In this file, there is an unnamed namespace that defined a function validateSignature() (example below), which seemed invisible outside the file and thus could not be tested (and thus could not be covered), decreasing code coverage from 100%. In the end, I added .covrignore file to manually disable code coverage on this file. I noticed that some auto-generated files are already ignored by covr including RcppExports.cpp, RcppExports.R and <pkg_name>.h. Should this auto-generated file inst/include/<pkg_name>_RcppExports.h also be ignored by default?

Here is an example with some auto-generated code not covered.

@zhuxr11 zhuxr11 changed the title Github test-coverage workflow tests Rcpp-generated header file in inst/include/<pkg_name>_RcppExports.h Github test-coverage workflow does not ignore an Rcpp auto-generated header file inst/include/<pkg_name>_RcppExports.h Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant