From pgilbert at bank-banque-canada.ca  Mon Oct  5 22:37:23 2009
From: pgilbert at bank-banque-canada.ca (Paul Gilbert)
Date: Mon, 5 Oct 2009 16:37:23 -0400
Subject: [Rd] unit testing for R packages?
In-Reply-To: <486f230c0910051248xd9d9ab9ie3ac6358184e2989@mail.gmail.com>
References: <6c35a4fc0910051201h23e61e39o55bf1de9809bfe29@mail.gmail.com>
	<486f230c0910051248xd9d9ab9ie3ac6358184e2989@mail.gmail.com>
Message-ID: <D611103AA7EE3B4DAE7F7D49C72B291A01D6BE84@EXMAIL2.bocad.bank-banque-canada.ca>

Seth

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?

Thanks,
Paul

> -----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.


[Rd] unit testing for R packages?
Paul Gilbert