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

Load package 'methods' in GnuR Rscript sessions and do not ignore

recommended packages for GnuR.
parent 84b82282
No related branches found
No related tags found
No related merge requests found
......@@ -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