Re: [Rd] test suites for packages

From: Claudia Beleites <claudia.beleites_at_ipht-jena.de>
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.

Claudia

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" <armstrong.whit_at_gmail.com> 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
>>
>> ______________________________________________
>> R-devel_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel

>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
-- 
Claudia Beleites
Spectroscopy/Imaging
Institute of Photonic Technology
Albert-Einstein-Str. 9
07745 Jena
Germany

email: claudia.beleites_at_ipht-jena.de
phone: +49 3641 206-133
fax:   +49 2641 206-399

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
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 https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive