[R-pkg-devel] Handling Not-Always-Needed Dependencies? - Part 2

Uwe Ligges ligges at statistik.tu-dortmund.de
Thu Aug 4 17:55:31 CEST 2016



On 04.08.2016 17:46, Paul Gilbert wrote:
> (One question from the thread Handling Not-Always-Needed Dependencies?)
>
> I hope not to start another long tangled thread, but I have a basic
> confusion which I think has a yes/no answer and I would like to know if
> there is agreement on this point (or is it only me that is confused as
> usual).
>
> If my package has a test that needs another package, but that package is
> not needed in the /R code of my package, then I indicate it as
> "Suggests", not as "Depends" nor as "Imports".  If that package is not
> available when I run R CMD check, should the test pass?
>
> Yes or no:  ?

Yes, as the package should pass the checks if suggested packages are 
unavailable.
BUT if these are available and the code is wrong, then it should 
generate an error.

Best,
Uwe



>
> (I realize my own answer might be different if the package was used in
> an example or demo in place of a test, but that is just the confusion
> caused by too many uses for Suggests. In the case of a test, my own
> thought is that the test must fail, so my own answer is no. If the test
> does not fail then there is no real testing being done, thus missing
> code coverage in the testing. If the answer is no, then the tests do not
> need to be run if the package is not available, because it is known that
> they must fail. I think that not bothering to run the tests because the
> result is known is even more efficient than other suggestions. I also
> think it is the status quo.)
>
> Hoping my confusion is cleared up, and this does not become another long
> tangled thread,
> Paul
>
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



More information about the R-package-devel mailing list