Unit tests for code in the /src folder of an R package?

自古美人都是妖i 提交于 2019-12-04 03:20:50

I find the question a little confused:

  • Either you consider your C code to be in support of higher-level R functions that you can test at the R (as you seem to have done)

  • Or you consider your C code to be more standalone, in which case you could use one of a bazillion unit testing frameworks for C.

Many of the packages using Rcpp also use extensive unit testing, either via RUnit, or via testthat. You could look at that. I generally test at the R function level, which often implies a test of the underlying C++ function.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!