[Rcpp-devel] How to manage testing code for Rcpp based project?
pengyu.ut at gmail.com
Sat Aug 4 18:22:58 CEST 2012
I have trouble in finding a good strategy for organizing test cases to
have complete coverage for Rcpp based code.
The example in RcppArmadillo_0.3.2.4/inst/unitTests has some problem
in the sense that, each file is too large --- if there is a little
change the whole test file should be run, which takes more time than
necessary. I think that having a more granular test file organization
can be beneficial. Also, the test file is not in close proximity to
the function being tested. This cause inefficient when navigating
between the testing code and the function to be tested.
There are many ways in solving these problems in other languages. For
example, primitive test code can be embedded in the docstring in
python. I'm wondering if anybody knows the best software engineering
practice for working with Rcpp code.
BTW, the test code in RcppArmadillo_0.3.2.4/inst/unitTests can be run
only after RcppArmadillo is installed. For a developer, he/she does
not always want to install the package before he/she can run the test
case. "devtools" solves this problem for pure R package. I'm wondering
if there is any equivalent thing for Rcpp based packages.
More information about the Rcpp-devel