Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions pkg/R/tinytest.R
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,13 @@ build_install_test <- function(pkgdir="./", testdir="tinytest"
setwd(tdir)

## build package
system2("R", args=c("CMD", "build", "--no-build-vignettes", "--no-manual", shQuote(pkg)))
if(.Platform$OS.type == "windows") {
system2(file.path(R.home("bin"), "Rterm.exe")
, args=c("CMD", "build", "--no-build-vignettes", "--no-manual", shQuote(pkg)))
} else {
system2(file.path(R.home("bin"), "R")
, args=c("CMD", "build", "--no-build-vignettes", "--no-manual", shQuote(pkg)))
}


## find tar.gz and install in temporary folder.
Expand Down Expand Up @@ -1198,7 +1204,11 @@ if (!is.null(cluster)) parallel::stopCluster(cluster)
, encoding)

write(scr, file="test.R")
system("Rscript test.R")
if(.Platform$OS.type == "windows") {
system2(file.path(R.home("bin"), "Rscript.exe"), args="test.R")
} else {
system2(file.path(R.home("bin"), "Rscript"), args="test.R")
}

readRDS(file.path(tdir, "output.RDS"))

Expand Down