Hi All, I'm interested in putting some unit tests into an R package I'm building. I have seen assorted things such as Runit library, svUnit library, packages with 'tests' directories, etc I grep'd "unit test" through the writing R extensions manual but didn't find anything. Are there any suggestions out there? Currently I have several (a lot?) classes/methods that I keep tinkering with, and I'd like to run a script frequently to check that I don't cause any unforeseen problems. Right now I'm writing the classes/methods, but will be packaging it up soon. Thx, Blair
If you haven't done so already, you might want to read the RUnit Vignette: http://cran.r-project.org/web/packages/RUnit/vignettes/RUnit.pdf. On a somewhat related note: is anyone doing "continuous integration" with their R packages? I'm thinking about trying to use something like CruiseControl (which I used before for Java development), and was wondering if anyone had experience with how much work will be involved... On Mon, Oct 5, 2009 at 3:01 PM, Blair Christian <blair.christian@gmail.com>wrote:> Hi All, > > I'm interested in putting some unit tests into an R package I'm > building. I have seen assorted things such as Runit library, svUnit > library, packages > with 'tests' directories, etc > > I grep'd "unit test" through the writing R extensions manual but didn't > find > anything. Are there any suggestions out there? Currently I have > several (a lot?) classes/methods that I keep tinkering with, and I'd > like to run a script frequently to check that I don't cause any > unforeseen problems. > > Right now I'm writing the classes/methods, but will be packaging it up > soon. > > Thx, > Blair > > ______________________________________________ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >[[alternative HTML version deleted]]
On 10/5/2009 3:01 PM, Blair Christian wrote:> Hi All, > > I'm interested in putting some unit tests into an R package I'm > building. I have seen assorted things such as Runit library, svUnit > library, packages > with 'tests' directories, etc > > I grep'd "unit test" through the writing R extensions manual but didn't find > anything. Are there any suggestions out there?Nothing very specific, but what there is is described in that manual in the discussion of the "tests" subdirectory. Duncan Murdoch Currently I have> several (a lot?) classes/methods that I keep tinkering with, and I'd > like to run a script frequently to check that I don't cause any > unforeseen problems. > > Right now I'm writing the classes/methods, but will be packaging it up soon. > > Thx, > Blair > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Hi, On Mon, Oct 5, 2009 at 12:01 PM, Blair Christian <blair.christian at gmail.com> wrote:> I'm interested in putting some unit tests into an R package I'm > building. ?I have seen assorted things such as Runit library, svUnit > library, packages > with 'tests' directories, etc > > I grep'd "unit test" through the writing R extensions manual but didn't find > anything. ?Are there any suggestions out there? ?Currently I have > several (a lot?) classes/methods that I keep tinkering with, and I'd > like to run a script frequently to check that I don't cause any > unforeseen problems.I've had good experiences using RUnit. To date, I've mostly used RUnit by putting tests in inst/unitTests and creating a Makefile there to run the tests. You should also be able to use RUnit in a more interactive fashion inside an interactive R session in which you are doing development. The vignette in svUnit has an interesting approach for integrating unit testing into R CMD check via examples in an Rd file within the package. + seth -- Seth Falcon | @sfalcon | http://userprimary.net/user