[Bioc-devel] testthat instructions for website
lawrence.michael at gene.com
Sat Mar 14 04:29:36 CET 2015
On Fri, Mar 13, 2015 at 6:06 PM, Michael Love <michaelisaiahlove at gmail.com>
> hi Bioc team,
> Can we add some testthat instructions to the unit testing page:
> I presume the instructions would be simply to follow the basic
> testthat instructions, e.g.:
> ...add testthat to Suggests, put tests in files starting with 'test'
> inside tests/testthat/ and write a file tests/testthat.R with specific
> code in it. I think this is what the packages here are all doing:
> ~~~~ end of request, details continue below ~~~~
> My reasons for wanting that Bioconductor support testthat in addition
> to RUnit is that RUnit does not make it very simple to run all tests,
> which should be a very simple thing to do.
> With testthat, this is simply a call to test() which lives in
> devtools. With RUnit you have to do:
> runTestSuite(defineTestSuite("myTest", "inst/unitTests/","test_"))
> Although that's not quite enough. That will not run the same test as
> Bioconductor, or as if you ran the code in the test files in your
> console, because defineTestSuite picks rngKind =
> "Marsaglia-Multicarry" and rngNormalKind = "Kinderman-Ramage", which
> are not the current R default random number generators.
> So then you have to do:
> runTestSuite(defineTestSuite("myTest", "inst/unitTests/","test_",
> rngKind = "default", rngNormalKind = "default"))
> Or you could call BiocGenerics:::testPackage(), but we probably all
> agree it's better that unit testing have a documented, exported
It's probably past time that we export/document that function. Or perhaps
even contribute it back to RUnit.
> Bioc-devel at r-project.org mailing list
[[alternative HTML version deleted]]
More information about the Bioc-devel