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
|
#!/bin/sh
LOGFILE=test.log
R --vanilla --slave > ${LOGFILE} 2>&1 <<'EOF'
library(iterators)
library(RUnit)
options(warn=1)
options(showWarnCalls=TRUE)
cat('Starting test at', date(), '\n')
tests <- c('basicTest.R', 'iapplyTest.R', 'isplitTest.R',
'icountnTest.R', 'chunksizeTest.R', 'recycleTest.R')
errcase <- list()
for (f in tests) {
cat('\nRunning test file:', f, '\n')
t <- runTestFile(f)
e <- getErrors(t)
if (e$nErr + e$nFail > 0) {
errcase <- c(errcase, t)
print(t)
}
}
if (length(errcase) == 0) {
cat('*** Ran all tests successfully ***\n')
} else {
cat('!!! Encountered', length(errcase), 'problems !!!\n')
for (t in errcase) {
print(t)
}
}
cat('Finished test at', date(), '\n')
EOF
|