[Rcpp-devel] How to manage testing code for Rcpp based project?

Dirk Eddelbuettel edd at debian.org
Sat Aug 4 18:34:34 CEST 2012


On 4 August 2012 at 11:22, Peng Yu wrote:
| Hi,
| 
| 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

It gets worse. You even have to install R. And a C++ compiler. Gee.

Seriously:  please think through what you are suggesting here. We are talking
about __compiled language__ and outside of a time machine I see very few
tools that would permit you to __test before installation__.

Dirk

| 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.
| 
| Thanks!
| 
| -- 
| Regards,
| Peng
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  


More information about the Rcpp-devel mailing list