-
Notifications
You must be signed in to change notification settings - Fork 27
/
checks.R
48 lines (39 loc) · 1.38 KB
/
checks.R
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
require("tools")
make_check <- function(srcpkg, dir = "./") {
if (dir == "") dir <- "./"
.libPaths("")
options(repos = "http://CRAN.at.R-project.org")
odir <- setwd(dir)
pkg <- strsplit(srcpkg, "_")[[1]][1]
cdir <- paste(pkg, "CRAN", sep = "_")
ddir <- paste(pkg, "devel", sep = "_")
if (!file.exists(cdir)) {
dir.create(cdir)
} else {
system(paste("rm -rf", cdir))
dir.create(cdir)
}
if (!file.exists(ddir)) {
dir.create(ddir)
} else {
system(paste("rm -rf", ddir))
dir.create(ddir)
}
file.copy(srcpkg, ddir)
download.packages(pkg, repos = options("repos"), destdir = cdir)
check_packages_in_dir(cdir, reverse = list(), Ncpus = 4)
check_packages_in_dir(ddir, reverse = list(), Ncpus = 4)
cat("\n\nReverse tests with CRAN package:\n")
summarize_check_packages_in_dir_results(cdir, all = TRUE)
summarize_check_packages_in_dir_timings(cdir, all = TRUE)
cat("\n\nReverse tests with NEW package:\n")
summarize_check_packages_in_dir_results(ddir, all = TRUE)
summarize_check_packages_in_dir_timings(ddir, all = TRUE)
cat("\n\nComparison of results:\n")
check_packages_in_dir_changes(ddir, cdir, outputs = TRUE, sources = TRUE)
# setwd(odir)
}
# package_dependencies("mboost", available.packages(), reverse = TRUE)
owd <- setwd("../")
make_check(srcpkg = "mboost_2.8-0.tar.gz")
setwd(owd)