[R] Approaches to using RUnit

Seth Falcon sfalcon at fhcrc.org
Mon Aug 9 18:07:15 CEST 2004


Having used JUnit and PyUnit, I was pleased to see the release of the
RUnit package on CRAN.

I'm wondering if there are any RUnit users out there that would be
willing to share some tips on how they organize their code to work with
RUnit.

Specifically, I'm wondering about the best way to load/import/source the
functions to be tested.  I would like to end up with a script, testall
or some such, that allows me to run all the unit tests in a given
directory.


One way I've thought about looks like:

myfunc.R
--------------
# some functions here
--------------

runit_myfunc.R
--------------
source("myfunc.R")

# test function here
--------------


+ seth




More information about the R-help mailing list