https://github.com/cran/doParallel
Raw File
Tip revision: 6f22078d13927e423c8a1bb77c3a3bf17c8c4064 authored by Hong Ooi on 02 August 2019, 03:40:02 UTC
version 1.0.15
Tip revision: 6f22078
runTestSuite.sh
#!/bin/sh

LOGFILE=test.log

R --vanilla --slave > ${LOGFILE} 2>&1 <<'EOF'
library(doParallel)
library(RUnit)

verbose <- as.logical(Sys.getenv('FOREACH_VERBOSE', 'FALSE'))

library(doParallel)
registerDoParallel()

options(warn=1)
options(showWarnCalls=TRUE)

cat('Starting test at', date(), '\n')
cat(sprintf('doParallel version: %s\n', getDoParVersion()))
cat(sprintf('Running with %d worker(s)\n', getDoParWorkers()))

tests <- c('options.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)
  }
}

stopImplicitCluster()

cat('Finished test at', date(), '\n')
EOF
back to top