[R] Approaches to using RUnit

Seth Falcon sfalcon at fhcrc.org
Thu Aug 12 18:25:07 CEST 2004


On Tue, Aug 10, 2004 at 04:53:49PM +0200, Klaus Juenemann wrote:
> If you don't organize your code into packages but source individual R
> files your approach to source the code at the beginning of a test file
> looks the right thing to do.

Appears to be working pretty well for me too ;-)

> We mainly use packages and the code we use to test packages A and B, 
> say, looks like 

SNIP

> We use the tests subdirectory of a package to store our RUnit tests
> even though this is not really according to R conventions.

In an off list exchange with A.J. Rossini, we discussed an alternative
for using RUnit in a package.  The idea was to put the runit_*.R files
(containing test code) into somePackage/inst/runit/ and then put a
script, say dorunit.R inside somePackage/test/ that would create the
test suite's similar to the code you included in your mail.  The
advantage of this would be that the unit tests would run using R CMD
check.

In the next week or so I hope to package-ify some code and try this out.  


+ seth




More information about the R-help mailing list