RUnit test framework

Yohan Chalabi chalabi at phys.ethz.ch
Wed Jan 9 10:49:59 CET 2008


Dirk Eddelbuettel wrote:
> I finally got around to studying the nice Unit test framework now in
> Rmetrics, and started to adopt it for RQuantLib.  As my source directories
> often have names like RQuantLib-0.2.8, I needed to another small change in tests/doRUnit.R:
>
>     wd <- getwd()
>     pkg <- sub("\\.Rcheck$", '', basename(dirname(wd))) 	# sub out trailing .Rcheck
>     pkg <- gsub("[0-9.-]*$", '', pkg)				# sub out -0.1.2 number
>
> ie I added that 3rd line to substitute out the '-0.2.8' part --- or else it
> fails.
>
> One quick question:  why do none of the unit tests use the 'checkEquals()'
> framework?
>
> Cheers, Dirk
>
>   
Hi Dirk,

The use of Unit test framework in Rmetrics is rather recent and there 
are still room for a lot of improvement. For the moment we focus on 
tests which check if everything is running and we compare values where 
we do not need to set a  tolerance threshold. In the future we will 
check numerical results with tolerance and use the function 
checkEquals(). But for the moment we stick to checkIdentical().

regards,
Yohan



More information about the Rmetrics-core mailing list