Skip to content
Snippets Groups Projects
Commit 878abcde authored by Florian Angerer's avatar Florian Angerer
Browse files

[GR-7687] [GR-7329] Incorrect use of Rscript in package testing.

PullRequest: fastr/1319
parents 8abab683 5892260c
No related branches found
No related tags found
No related merge requests found
......@@ -103,11 +103,18 @@ public class LogFileParser {
this.reader = r;
consumeLine();
// consume any leading lines (there might be some output of 'mx')
collectBody(Token.BEGIN_INSTALL_TEST);
Section installTest0 = parseInstallTest();
logFile.addSection(installTest0);
if (!installTest0.isSuccess()) {
return logFile;
}
// again, consume any leading lines
collectBody(Token.BEGIN_INSTALL_TEST);
Section installTest1 = parseInstallTest();
logFile.addSection(installTest1);
if (installTest1.isSuccess()) {
......
......@@ -21,6 +21,10 @@
# questions.
#
is.fastr <- function() {
length(grep('FastR', R.Version()$version.string))
}
# A simple log function; to be replaced by a user of this file.
log.message <- function(..., level=0) {
cat(..., "\n")
......@@ -255,7 +259,7 @@ recommended.base.packages <- c("boot", "class", "cluster", "codetools", "foreign
base.packages <- c("base", "compiler", "datasets", "grDevices", "graphics", "grid", "methods", "parallel", "splines", "stats", "stats4", "tools", "utils")
# the list of packages that will be excluded in the transitive dependecies
ignored.packages <- recommended.base.packages
ignored.packages <- if (is.fastr()) recommended.base.packages else base.packages
package.dependencies <- function(pkg, lib, dependencies = c("Depends", "Imports", "LinkingTo"), pl = available.packages()) {
if (!(pkg %in% rownames(pl))) {
......
......@@ -135,6 +135,8 @@ trim <- function (x) gsub("^\\s+|\\s+$", "", x)
strip.version <- function(x) gsub("\\s*\\(.*\\)$", "", x)
initial.packages <- c("methods", "datasets", "utils", "grDevices", "graphics", "stats")
default.packages <- c("R", "base", "grid", "splines", "utils",
"compiler", "grDevices", "methods", "stats", "stats4",
"datasets", "graphics", "parallel", "tools", "tcltk")
......@@ -857,12 +859,16 @@ is.fastr <- function() {
system.test <- function(pkgname) {
script <- normalizePath("com.oracle.truffle.r.test.packages/r/test.package.R")
options <- character(0)
if (is.fastr()) {
rscript = file.path(R.home(), "bin", "Rscript")
} else {
rscript = gnu_rscript()
# GnuR's Rscript command does not load the 'methods' package by default.
# But the examples are assumed to be run in a shell where the package is on the search path.
options <- paste0("--default-packages=", paste0(initial.packages, collapse=","))
rscript = gnu_rscript()
}
args <- c(script, pkgname, file.path(testdir, pkgname), lib.install)
args <- c(options, script, pkgname, file.path(testdir, pkgname), lib.install)
# 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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment