diff --git a/com.oracle.truffle.r.test.packages/r/install.packages.R b/com.oracle.truffle.r.test.packages/r/install.packages.R index cf3901e4d873e895d85402a09baaf3b92c3d88d3..521ac7415d56a733370b5738aae49d4c35bd323e 100644 --- a/com.oracle.truffle.r.test.packages/r/install.packages.R +++ b/com.oracle.truffle.r.test.packages/r/install.packages.R @@ -164,6 +164,19 @@ choice.depends <- function(pkg, choice=c("direct","suggests")) { unname(all.deps) } +# provides JVM args when running the tests +fastr.test.jvm.args <- function() { + mx.args.file <- "com.oracle.truffle.r.test.packages/test.mx.args" + tryCatch({ + if (file.exists(mx.args.file)) { + opts <- paste0('"', paste0("--Ja @", readLines(mx.args.file), collapse=" "), '"') + log.message(paste0("MX_R_GLOBAL_ARGS=", opts), level=1) + return (opts) + } + }) + return ("'--Ja @-DR:+IgnoreGraphicsCalls'") +} + # returns a vector of package names that are the direct dependents of pkg direct.depends <- function(pkg) { choice.depends(pkg, "direct") @@ -837,7 +850,12 @@ system.test <- function(pkgname) { # we want to stop tests that hang, but some packages have many tests # each of which spawns a sub-process (over which we have no control) # so we time out the entire set after 20 minutes. - rc <- system2(rscript, args, env=c("FASTR_PROCESS_TIMEOUT=20", paste0("R_LIBS_USER=",shQuote(lib.install)),"R_LIBS=")) + env <- c("FASTR_PROCESS_TIMEOUT=20", + paste0("R_LIBS_USER=", shQuote(lib.install)), + "R_LIBS=", + paste0("MX_R_GLOBAL_ARGS=", fastr.test.jvm.args()) + ) + rc <- system2(rscript, args, env=env) rc }