[Rprotobuf-yada] package ready or unit tests

Romain Francois romain.francois at dbmail.com
Sat Dec 26 18:16:30 CET 2009


On 12/26/2009 06:11 PM, Dirk Eddelbuettel wrote:
> On 26 December 2009 at 17:44, Romain Francois wrote:
> | I've added utils to the list of default packages used in the Makefile
> | that makes the vignettes. (Sweave is in utils)
>
> Doh, should have thought of that myself. Thanks!
>
> Build and check of the tarball work now, but I still bomb at
>
> Running the tests in 'tests/doRUnit.R' failed.
> Last 13 lines of output:
>    Error in func() : boom
>     done successfully.
>
>
>
>    Executing test function test.failure  ... Timing stopped at: 0.004 0 0.001
>    Error in checkEquals(1, 2) : Mean relative difference: 1
>     done successfully.
>
>    Error in eval.with.vis(expr, envir, enclos) :
>      one of the unit tests failed
>    Calls: source ->  eval.with.vis ->  eval.with.vis
>    Execution halted
>
> And from the installed package I get
>
>
> R>  tests<- runTestSuite(testSuite)
>
>
> Executing test function test.draft  ... Error in eval(expr, envir = parent.frame()) : ouch
>   done successfully.
>
>
>
> Executing test function test.draft2  ... Error in eval(expr, envir = parent.frame()) : ouch
>   done successfully.
>
>
>
> Executing test function test.error  ... Timing stopped at: 0 0 0
> Error in func() : boom
>   done successfully.
>
>
>
> Executing test function test.failure  ... Timing stopped at: 0.004 0 0.002
> Error in checkEquals(1, 2) : Mean relative difference: 1
>   done successfully.
>
> R>
>
> I don't understand how 'Error in ...' and 'done successfully' can coexist here.
>
> Dirk

I think this is the expected result. Currently I have a test that 
generates an error (in runit.error.R)

test.error <- function(){
	stop( "boom" )
}

test.failure <- function(){
	checkEquals( 1, 2 )
}

so the test.error generates an error, which is picked up by RUnit.

Then, the way R CMD check and RUnit are combined is to fail R CMD check 
if one unit test fails. not sure this is also the case for failures.

-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/IlMh : CPP package: exposing C++ objects
|- http://tr.im/HlX9 : new package : bibtex
`- http://tr.im/Gq7i : ohloh





More information about the Rprotobuf-yada mailing list