[go: up one dir, main page]

Menu

[cfa9b7]: / runTest.R  Maximize  Restore  History

Download this file

35 lines (28 with data), 951 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
## Bring back the R_LIBS location
localLib <- Sys.getenv("R_LIBS")
.libPaths(localLib)
if (interactive()){
cmd <- c("output")
}else{
cmd <- commandArgs(TRUE)
}
packageSource <- cmd[1]
install.packages(packageSource, repos=NULL, lib=localLib, INSTALL_opts = "--no-lock", type="source")
require(ddmore, lib.loc = localLib)
require(testthat, lib.loc = localLib)
require(XML, lib.loc = localLib)
## Parse command line arg
outputFolder <- cmd[2]
packageName <- "ddmore"
## Load Dependencies
require(tools)
dpds <- pkgDepends(packageName)$Depends
lapply(strsplit(dpds, " "), FUN = function(e){require(e[1], character.only = TRUE)})
## Run tests
try( test_package(packageName,
reporter = JUnitReporter$new(file =file.path(getwd(),
paste("testReport", packageName, ".xml", sep = "") )))
)
message("Saving test report to ", getwd())
message("Saving warnings to ", getwd())
warnings(file = file.path(getwd(),"testWarnings.log"), append=TRUE)