tinytest icon indicating copy to clipboard operation
tinytest copied to clipboard

Check path to R and Rscript before calling

Open TimTaylor opened this issue 1 year ago • 0 comments

Currently if you have multiple builds of R installed on your system then, irrespective of the one being run, build_install_test() will call in to the default R. I ran in to this when testing on an R-devel install this morning. This can be resolved by querying the R path before constructing the call ...

E.g. replacing

system2("R", args=c("CMD", "build", "--no-build-vignettes", "--no-manual", shQuote(pkg)))

by

system2(file.path(R.home("bin"), "R")
              , args=c("CMD", "build", "--no-build-vignettes", "--no-manual", shQuote(pkg)))

with similar changes for Rscript and a slightly different incantation for Windows.

I've made PR https://github.com/markvanderloo/tinytest/pull/134 to implement this change. Currently it is marked as a draft as I have only checked it works on a linux machine not Windows. I'll try and sort a windows check over the next couple of days.

TimTaylor avatar Nov 27 '24 09:11 TimTaylor