From Torsten.Hothorn at rzmail.uni-erlangen.de  Tue Jul 25 10:21:01 2006
From: Torsten.Hothorn at rzmail.uni-erlangen.de (Torsten Hothorn)
Date: Tue, 25 Jul 2006 10:21:01 +0200 (CEST)
Subject: [Rd] Package Unit Testing
In-Reply-To: <loom.20060725T013553-801@post.gmane.org>
References: <d35b9da60607021843j5ec840e5j3b69bde225bfa195@mail.gmail.com>
	<17576.50090.402802.304218@stat.math.ethz.ch>
	<loom.20060725T013553-801@post.gmane.org>
Message-ID: <Pine.LNX.4.64.0607251019510.18625@imbe153.imbe.med.uni-erlangen.de>


On Mon, 24 Jul 2006, Gregor Gorjanc wrote:

> Martin Maechler <maechler <at> stat.math.ethz.ch> writes:
>
>>
>>>>>>> "miguel" == miguel manese <jjonphl <at> gmail.com>
>>>>>>>     on Mon, 3 Jul 2006 09:43:12 +0800 writes:
>>
>>     miguel> Hello, Do we have like an official unit testing
>>     miguel> framework for packages? Like we do R CMD check, and
>>     miguel> say the scripts in <pkg>/test are executed?
>>
>> yes.  Just it's  "./tests",  not './test'.
>>
>> More specifically, all ./tests/*.R are executed and for those
>> foobar.R for which there's a  foobar.Rout.save  file,
>> the output is (R CMD Rdiff)ed agains the result of running foobar.R
>>
>> All this should be pretty obvious from the manual
>> "Writing R Extensions".
>> What was it in there that was not clear enough?
>
> I just tried to find relevant information and searched the whole Writing R
> Extensions manual on word test. I have find information Martin stated above,
> but failed to find how *.Rout.save should be created. I think that manual
> should say that. Did I miss something obvious? I am also not able to find
> Rdiff COMMAND in man page of R under Debian.
>
> Browsing a bit in sources reveals that *.Rout.save is copy of R session
> (starts with "welcome" text and later one code and output is there).
> But how does one generate such a file?

either R CMD BATCH or simply run R CMD check <pkg> once and copy 
<pkg>.Rcheck/tests/*.Rout into <pkg>/tests/*Rout.save

> Additionally, does testing also
> test the first "welcome" text - different version of R haave a bit different
> "welcome" text and that should be an error then or ...

R CMD check takes care of that.

Best,

Torsten

>
> Thanks!
>
> Gregor
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>



[Rd] Package Unit Testing
Torsten Hothorn