xtensor-stack / Xtensor.R

R package for xtensor-r
http://quantstack.net/xtensor
Other
17 stars 7 forks source link

Feature/improved tests #6

Closed DavisVaughan closed 5 years ago

DavisVaughan commented 5 years ago

This PR improves the test suite of xtensor to use testthat in a more standard fashion. Specifically, a few of the changes are:

A bit more on the new test structure. I talked with some of my RStudio folks on the best way to have cpp files that only get run during tests, and then called from the R test files. I was encouraged to just place them in src/ and use the Rcpp::export attribute which makes them callable from R for the tests, but not to the general R user who uses the package. At first I tried placing the cpp files in tests/testthat/<test.cpp> and that worked with devtools::check() but not devtools::test() because of some include path problems. All in all, placing them in src/ might seem annoying at the surface level, but I'm convinced it is ultimately the most stable way to do this.

I also added the header folders to the gitignore because they kept popping up in RStudio as suggestions to commit. Hopefully that's fine.

SylvainCorlay commented 5 years ago

Hey @DavisVaughan thanks a lot for this. I am really glad we don't need to expose test functions. This is much better.

I have left a comment regarding the files generated by Rcpp which I think can be added to .gitignore since they are generated with the configure script.

DavisVaughan commented 5 years ago

Should be good to go now

SylvainCorlay commented 5 years ago

Thanks!