-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdclone_tests.R
More file actions
46 lines (42 loc) · 1.7 KB
/
dclone_tests.R
File metadata and controls
46 lines (42 loc) · 1.7 KB
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
library(dclone)
if (.Platform$OS.type == "windows") {
source("c:/svn/dcr/devel/common.R")
} else {
source("/home/peter/svn/dcr/devel/common.R")
}
ff <- if (.Platform$OS.type == "windows") {
gsub(".Rd", "", list.files("c:/svn/dcr/pkg/dclone/man"))
} else {
gsub(".Rd", "", list.files("/home/peter/svn/dcr/devel/tests/dclone/man"))
}
#ff <- "parCodaSamples"#"write.jags.model"
ff
keep <- unique(c("keep", "topic", ls()))
cat("\n\n## <<<<<<<<<<<<<< ", date(), " >>>>>>>>>>>>>>>>>\n\n")
for (topic in ff) {
rm(list = ls()[setdiff(ls(), keep)])
cat("\n\n## START <<<<<<<<<<<<<< ", topic, " >>>>>>>>>>>>>>>>>\n")
exampleDontRun(topic, pkg="dclone")
cat("\n## END <<<<<<<<<<<<<< ", topic, " >>>>>>>>>>>>>>>>>\n\n")
}
cat("\n\n## START <<<<<<<<<<<<<< endmatter >>>>>>>>>>>>>>>>>\n")
x <- readLines(paste(DIR, "/tests/dclone_tests.log", sep=""))
err <- c(grep("rror", x), grep("arning", x))
fal <- grep("d error", x)
err <- err[!(err %in% fal)]
if (length(err)) {
beg <- c(grep("## START <<<<<<<<<<<<<<", x), length(x))[-1]
fin <- grep("## END <<<<<<<<<<<<<<", x)
top <- gsub(" >>>>>>>>>>>>>>>>>", "", gsub("## START <<<<<<<<<<<<<< ", "", x[beg]))
y <- character(length(x))
y[1:(beg[1]-1)] <- "begin"
for (i in 1:(length(beg)-1))
y[beg[i]:(beg[i+1]-1)] <- top[i]
y[(fin[length(fin)]:length(y))] <- "endmatter"
y <- y[err]
cat("\n\n## <<<<<<<<<<<<<< Errors/Warnings found >>>>>>>>>>>>>>>>>\n\n")
data.frame(Line=err, Topic=y, Text=x[err])
} else cat("\n\n## <<<<<<<<<<<<<< OK -- No Errors/Warnings found >>>>>>>>>>>>>>>>>\n\n")
options(op)
rm(list = ls())
## EOF