[Rd] unit testing for R packages?

Paul Gilbert pgilbert at bank-banque-canada.ca
Mon Oct 5 22:37:23 CEST 2009


I should look at RUnit more carefully sometime, but having had my own system in place from much earlier, I've never made the move. Basically I just use files in the tests/ directory which are run by a makefile in the package directory above. Roughly, this just means that I can run the tests quickly before building and checking the package. Is there a (very short) explanation of the main things that RUnit gives beyond this?


> -----Original Message-----
> From: r-devel-bounces at r-project.org [mailto:r-devel-bounces at r-
> project.org] On Behalf Of Seth Falcon
> Sent: October 5, 2009 3:48 PM
> To: Blair Christian
> Cc: r-devel at r-project.org
> Subject: Re: [Rd] unit testing for R packages?
> 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
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

La version française suit le texte anglais.


This email may contain privileged and/or confidential information, and the Bank of
Canada does not waive any related rights. Any distribution, use, or copying of this
email or the information it contains by other than the intended recipient is
unauthorized. If you received this email in error please delete it immediately from
your system and notify the sender promptly by email that you have done so. 


Le présent courriel peut contenir de l'information privilégiée ou confidentielle.
La Banque du Canada ne renonce pas aux droits qui s'y rapportent. Toute diffusion,
utilisation ou copie de ce courriel ou des renseignements qu'il contient par une
personne autre que le ou les destinataires désignés est interdite. Si vous recevez
ce courriel par erreur, veuillez le supprimer immédiatement et envoyer sans délai à
l'expéditeur un message électronique pour l'aviser que vous avez éliminé de votre
ordinateur toute copie du courriel reçu.

More information about the R-devel mailing list