tests/testthat/helper-common.R

# This file is loaded automatically by testthat.
generate.set.seed <- function()
{
  seed <- sample(2^30, 1)
  cat("Seed: ", seed, "\n")
  set.seed(seed)
}

test_irace_detectCores <- function()
{
  if (identical(Sys.getenv("NOT_CRAN"), "true")) {
    x <- Sys.getenv("_R_CHECK_LIMIT_CORES_", "")
    if (nzchar(x) && x == "TRUE") return(2L)
    return(parallel::detectCores())
  }
  return(1L)
}

Try the irace package in your browser

Any scripts or data that you put into this service are public.

irace documentation built on Oct. 23, 2022, 5:06 p.m.