Re: [Rd] test suites for packages

From: Claudia Beleites <>
Date: Wed, 23 May 2012 18:47:04 +0200

I use svUnit, too.

I put a kind of standard skeleton into my packages that has a packagename.unittest () function that will run all svUnit tests (if svUnit is available). This function returns NA if svUnit is not available, invisible (TRUE) if all tests are passed and stops otherwise. Which will cause R CMD check to fail.

My test directory contains one single tests.R file with the two lines:

library (packagename)
packagename.unittest ()

which gives me e.g.:

Running the tests in ‘tests/tests.R’ failed. Last 13 lines of output:

    only logical matrix subscripts are allowed in replacement

While the 13 lines may not be enough if there are lots of tests, I can easily run packagename.unittest () in an interactive session and start tracking down the problem from there.


Am 18.05.2012 17:28, schrieb Cook, Malcolm:
> svUnit - is Runit compatible and provides some IDE integration and report
> generation and easy syntax for defining tests.
> I find it works a treat, and fits very nicely with my R coding/packaging
> style (which also uses inlinedocs for easy package creation).
> --Malcolm Cook
> On 5/17/12 9:10 AM, "Whit Armstrong" <> wrote:

>> Can anyone share some opinions on test suites for R packages?
>> I'm looking at testthat and RUnit. Does anyone have strong opinions on
>> either of those.
>> Any additional packages I should consider?
>> Thanks,
>> Whit
>> ______________________________________________
>> mailing list

> ______________________________________________
> mailing list
Claudia Beleites
Institute of Photonic Technology
Albert-Einstein-Str. 9
07745 Jena

phone: +49 3641 206-133
fax:   +49 2641 206-399

______________________________________________ mailing list
Received on Wed 23 May 2012 - 16:51:10 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 Wed 23 May 2012 - 17:31:19 GMT.

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

list of date sections of archive