Re: [Rd] RUnit testing with R CMD check and more

From: Martin Morgan <>
Date: Wed, 05 Sep 2007 09:43:37 -0700


One important scenario I use during development is to run selected unit tests, typically found in a single file. Usually this is preceeded by INSTALL rather than check, as I optimistically think that my changes will be an improvement and hence installing the package is a starting point for the next iteration.

(another) Martin

Gorjanc Gregor <> writes:

> Hello!
> I have looked at Martin's recent work on "merging" unit tests with R
> CMD check, fused it with my and Tony's contributions and developed
> it a bit further. Take a look into the attached demo package on how
> it works.
> In essence:
> PKG/inst/RUnitTests
> |- runRUnitTests.R (script to run RUnit tests)
> \- ... (any RUnit test file)
> PKG/R/runRUnitTests.R (wrapper function to call PKG/inst/RUnitTests/runRUnitTests.R)
> PKG/man/runRUnitTests.Rd (help with examples! section)
> The following can be achieved:
> * useRs can run RUnit tests from within R after the package has been
> installed on their machine - this info is also given in
> PKG-package.Rd file to encourage useRs to test the package
> * developeRs can run RUnit tests with:
> - R CMD check since examples in PKG/man/runRUnitTests.Rd are
> tested to work (test failures or R errors stop the R CMD check!)
> - launcing the script PKG/inst/RUnitTests/runRUnitTests.R with
> Rscript or R CMD check
> I would like to hear any critiques, comments, suggestions, ... on
> above. Martin mentioned (privately) that filenames have to much
> upper case letter, but I wanted to emphasize that the main work is
> being done by RUnit package - not developed by me!
> Finnally, I would like to argue that from useRs point of view test
> and unit test are the same thing and I believe that R would benefit
> if *all* tests could be available in similar manner as above. This
> of course calls for the modification of packaging, testing, etc.,
> but could provide more feedback (sure some of it will be bogous) on
> testing on various configurations.
> With regards, Gregor
> ______________________________________________
> mailing list

Martin Morgan
Bioconductor / Computational Biology

______________________________________________ mailing list
Received on Wed 05 Sep 2007 - 16:55:32 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 06 Sep 2007 - 00:40:29 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.