I follow the prompts of this question , but I'm impatient, and I would like to run my tests faster, without waiting for 30+ checks what R CMD check srccauses before checking tests.
what I thought I could do was add an option --standaloneto the doRUnit.Rone suggested in that R-wiki page , so that I can run unit tests regardless R CMD.
I added these lines to the script:
opt <- list(standalone=NULL)
if(require("getopt", quietly=TRUE)) {
opt <- getopt(matrix(c('standalone', 's', 0, "logical"),
ncol=4, byrow=TRUE))
if(!is.null(opt$standalone)) {
args <- commandArgs()
script.name <- substring(args[substring(args, 1, 7)=="--file="], 8, 1000)
if(!is.null(script.name))
setwd(dirname(script.name))
}
}
with this change, the script finds the files test.*\.R, regardless of the directory from which I call the script.
the remaining problem is that the doRUnit.Rscript loads the library installed , it is not the source()files that make up the library.
, R, ?
, ( "", "" ), ?