[Rprotobuf-yada] package ready or unit tests

Romain François francoisromain at free.fr
Sat Dec 26 17:17:57 CET 2009


On 12/26/2009 04:41 PM, Dirk Eddelbuettel wrote:
>
> On 26 December 2009 at 13:26, Romain François wrote:
> | I've added bits and pieces (inspired from how the fUtilities package
> | does it) to prepare the package for unit testing.
>
> Nice. I like that setup too. But it fails 'R CMD check' from SVN and that
> sucks:
>
> * checking tests ...
>    Running ‘doRUnit.R’
>   ERROR
> Running the tests in 'tests/doRUnit.R' failed.
> Last 13 lines of output:
>    +   pkg<- sub("\\.Rcheck$", '', basename(dirname(wd)))
>    +
>    +   library(package=pkg, character.only=TRUE)
>    +
>    +   path<- system.file("unitTests", package = pkg)
>    +
>    +   stopifnot(file.exists(path), file.info(path.expand(path))$isdir)
>    +
>    +   source(file.path(path, "runTests.R"), echo = TRUE)
>    + }
>    Error in library(package = pkg, character.only = TRUE) :
>      there is no package called 'pkg'
>    Execution halted
> edd at ron:~/svn/rprotobuf$
>
> That was running 'R CMD check pkg' as pkg/ is the subdir.
>
> The best fix I ever found for that was to ... hardcode the package name
> above.  Which feels like a crutch. Can you think of anything better?

Not really. I've put that in. Both making vignettes with R CMD build and 
just checking with R CMD check should work now.

I've also revisited the unit test vignette using brew.

> | The RProtoBuf-unitTests vignette has been resurrected and now will run
> | the unit tests and fetch the text results (not that exciting, but this
> | will do just fine [1]) into the vignette.
> |
> | tests are stored in runit.*.R files in the inst/unitTests directory
> |
> | so all we have to do to run the unit tests is to run R CMD build pkg
>
> One I change to
>
>    #wd<- getwd()
>    #pkg<- sub("\\.Rcheck$", '', basename(dirname(wd)))
>    pkg<- "RProtoBuf"
>
> it passes but doesn't build the vignette.
>
> | Now we need to populate the tests.
>
> Yup.
>
> Dirk
>


-- 
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