Re: [R] Package testing

From: Gábor Csárdi <>
Date: Wed, 16 Jun 2010 08:37:04 +0200


thanks, if the header is skipped, then it is much better.

It seems that I will be able to run the tests without actually running 'R CMD check' and extract the results, so it all looks good now.

Best Regards,

On Tue, Jun 15, 2010 at 7:25 PM, Duncan Murdoch <> wrote:
> Gábor Csárdi wrote:
>> Dear all,
>> I would like to write some tests for my R package, and the usual
>> 'tests' directory seemed like a good solution, but there is something
>> I cannot understand.
>> It is possible to supply files with the expected output for
>> the tests, which is great. But since the tests are not run with R
>> --slave, the expected output needs to contain all the extra output
>> from R, e.g. the startup message. The commands are echoed to the
>> output, too.
>> This makes it difficult to write proper tests, as they will
>> necessarily fail on all but one R versions (the version number is
>> always part of the output), and one would need to write the test
>> programs twice, once in the normal .R file, and once in the
>> file.
>> Is there a way to work around these things? Or am I trying to use the
>> 'tests' directory for something that was not intended?
> The normal workflow is to write the tests as R files, and run them.  Then
> manually check every line of the Rout, and when you're satisfied it's fine,
> save it as an file.  After that R will only report changes to that
> file that occur after the header, so version numbering changes will be
> ignored, but changes that affect your output will not.
> Duncan Murdoch

Gabor Csardi <>     UNIL DGM

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 16 Jun 2010 - 06:41:02 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 Wed 16 Jun 2010 - 07:00:33 GMT.

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

list of date sections of archive