Running ‘test-all.R’ [44s/86s]
Running the tests in ‘tests/test-all.R’ failed.
Complete output:
  > library(testthat)
  > test_check("SpaDES.tools")
  Loading required package: SpaDES.tools
  
   *** caught segfault ***
  address 8, cause 'memory not mapped'
  
  Traceback:
   1: qassert(classes, "S+")
   2: checkClass(x, classes, ordered, null.ok)
   3: assertClass(landscape, "Raster")
   4: spread2(a, start = sams, spreadProb = 0.225, asRaster = FALSE)
   5: eval(code, test_env)
   6: eval(code, test_env)
   7: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
   8: doTryCatch(return(expr), name, parentenv, handler)
   9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  10: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  11: doTryCatch(return(expr), name, parentenv, handler)
  12: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  13: tryCatchList(expr, classes, parentenv, handlers)
  14: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  15: test_code(desc, code, env = parent.frame())
  16: test_that("spread2 tests", {    library(raster)    library(data.table)    library(fpCompare)    library(quickPlot)    on.exit(detach("package:raster"), add = TRUE)    on.exit(detach("package:data.table"), add = TRUE)    on.exit(detach("package:fpCompare"), add = TRUE)    a <- raster(extent(0, 10, 0, 10), res = 1)    b <- raster(a)    sp <- 0.225    spRas <- gaussMap(b)    spRas[] <- spRas[]/maxValue(spRas) * sp/2 + sp/2 * 1.5    b[] <- 1    bb <- focal(b, matrix(1/9, nrow = 3, ncol = 3), fun = sum,         pad = TRUE, padValue = 0)    innerCells <- which(bb[] %==% 1)    sams <- sample(innerCells, 2)    set.seed(123)    for (i in 1:20) {        sams <- sample(innerCells, 2)        out <- spread2(a, start = sams, spreadProb = 0.225, asRaster = FALSE)        expect_true(length(unique(out$initialPixels)) == 2)        expect_true(all(out$active == 0))    }    if (interactive())         print("testing maxSize")    maxSizes <- 2:3    for (i in 1:20) {        seed <- sample(1e+06, 1)        set.seed(seed)        sams <- sample(innerCells, 2)        out <- spread2(a, start = sams, spreadProb = 0.225, maxSize = maxSizes,             asRaster = FALSE)        expect_true(all(out[, .N, by = "initialPixels"]$N <=             maxSizes[order(sams)]))    }    if (interactive())         print("testing exactSize")    exactSizes <- c(5, 3.1)    for (i in 1:20) {        sams <- sample(innerCells, 2)        out <- spread2(a, start = sams, spreadProb = 0.225, exactSize = exactSizes,             asRaster = FALSE)        attrib <- attr(out, "spreadState")$cluster$numRetries >             10        if (any(attrib)) {            frequ <- out[, .N, by = "initialPixels"]$N            expect_true(all(frequ[attrib] <= floor(exactSizes[order(sams)][attrib])))            expect_true(all(frequ[!attrib] == floor(exactSizes[order(sams)][!attrib])))        }        else {            expect_true(all(out[, .N, by = "initialPixels"]$N ==                 floor(exactSizes[order(sams)])))        }    }    if (interactive())         print("testing exactSize")    exactSizes <- c(5.01, 3.1, 4)    for (i in 1:20) {        sams <- sample(innerCells, length(exactSizes))        out <- spread2(a, start = sams, spreadProb = 0.225, exactSize = exactSizes,             asRaster = FALSE)        attrib <- attr(out, "spreadState")$clusterDT$numRetries >             10        if (any(attrib)) {            frequ <- out[, .N, by = "initialPixels"]$N            expect_true(all(frequ[attrib] <= floor(exactSizes[order(sams)][attrib])))            expect_true(all(frequ[!attrib] == floor(exactSizes[order(sams)][!attrib])))        }        else {            expect_true(all(out[, .N, by = "initialPixels"]$N ==                 floor(exactSizes[order(sams)])))        }    }    if (interactive())         print("testing exact maxSize, can't be achieved, allow jumping")    exactSizes <- c(154, 111, 134)    for (i in 1:20) {        seed <- sample(1e+06, 1)        set.seed(seed)        sams <- sample(innerCells, 3)        out <- spread2(a, start = sams, spreadProb = 0.225, exactSize = exactSizes,             asRaster = FALSE)        expect_true(all(out[, .N, by = "initialPixels"]$N < exactSizes))        expect_true(all(out$numRetries == 11))    }    if (interactive())         print("test circle = TRUE")    for (i in 1:20) {        message(i)        seed <- sample(1e+06, 1)        set.seed(seed)        sams <- sample(innerCells, length(sams))        expect_error(spread2(a, start = sams, spreadProb = runif(1,             1.00000001, 10000), circle = TRUE, asRaster = FALSE,             plot.it = TRUE))        expect_error(spread2(a, start = sams, spreadProb = runif(1,             -1e+05, -1e-08, 10000), circle = TRUE, asRaster = FALSE,             plot.it = TRUE))        out <- spread2(a, start = sams, spreadProb = 1, circle = TRUE,             asRaster = FALSE)        expect_true(is.numeric(out$distance))        expect_true(NROW(out) == ncell(a))    }    sams <- sort(sample(innerCells, 3))    out <- spread2(a, start = sams, spreadProb = 1, circle = TRUE,         asRaster = FALSE, returnDistances = TRUE)    expect_true(NROW(out) == ncell(a))    expect_true(all(out$state == "inactive"))    expect_true(all(out$distance <= (sqrt(2) * ncol(a))))    out <- spread2(a, start = sams, spreadProb = 1, circle = TRUE,         allowOverlap = TRUE, asRaster = FALSE, returnDistances = TRUE)    expect_true(NROW(out) == ncell(a) * length(sams))    expect_true(all(out$state == "inactive"))    expect_true(all(out$distance <= (sqrt(2) * ncol(a))))    setkey(out, initialPixels, distance)    if (interactive()) {        count <- 1        for (ids in unique(out$initialPixels)) {            dev(3 + count)            count <- count + 1            ras <- raster(a)            ras[] <- 0            ras[out[initialPixels == ids, pixels]] <- out[initialPixels ==                 ids, distance]            clearPlot()            Plot(ras)        }    }    if (interactive())         print("compare spread2 circle with cir circle")    cirOut <- data.table(cir(a, allowOverlap = TRUE, loci = sams,         minRadius = 0, maxRadius = 15, returnDistances = TRUE,         simplify = TRUE))    if (interactive()) {        for (ids in seq(unique(cirOut$id))) {            dev(3 + ids)            ras[cirOut[id == ids, indices]] <- cirOut[id == ids,                 dists]            clearPlot()            Plot(ras)        }    }    cirOut$dists <- round(cirOut$dists, 4)    out$distance <- round(out$distance, 4)    setkey(cirOut, id, dists)    cirOut <- unique(cirOut)    setnames(cirOut, "id", "initialPixels")    compare <- out[cirOut, on = c(initialPixels = "initialPixels",         pixels = "indices")]    expect_true(sum(abs(compare$dists - compare$distance)) %==%         0)    if (interactive())         print("Scales with number of starts, not maxSize of raster")    set.seed(21)    b <- raster(extent(0, 33000, 0, 33000), res = 1)    sams <- sample(ncell(b), 2)    st1 <- system.time({        out <- spread2(b, start = sams, spreadProb = 0.225, allowOverlap = TRUE,             asRaster = FALSE)    })    expect_lt(st1[1], 1)    if (interactive())         print("test neighProbs")    maxSizes <- 14    sp <- raster(a)    spreadProbOptions <- 1:5    sp[] <- sample(spreadProbOptions, ncell(sp), replace = TRUE)    set.seed(2123)    sams <- sample(innerCells, 2)    set.seed(321)    out <- spread2(a, spreadProb = 1, spreadProbRel = sp, start = sams,         neighProbs = c(0.7, 0.3), maxSize = maxSizes, asRaster = FALSE)    expect_true(uniqueN(out) == maxSizes * length(sams))    expect_true(NROW(out) == maxSizes * length(sams))    if (interactive())         print("check variable lengths of neighProbs")    set.seed(29937)    sams <- sample(innerCells, 2)    for (i in 1:8) {        alwaysN <- rep(0, i)        alwaysN[i] <- 1        out <- spread2(a, spreadProb = 1, spreadProbRel = sp,             iterations = 1, start = sams, neighProbs = alwaysN,             asRaster = FALSE)        expect_true(NROW(out) == (length(alwaysN) * 2 + length(sams)))    }    if (interactive()) {        print(paste("Test that when using neighProbs & a Raster of spreadProbs,",             "the spreadProb raster is followed probabilistically.",             "This test does only 1 iteration from 2 pixels that are",             "not interacting with edges or each other"))    }    sams <- sort(c(0:2 * 3 + 12) + rep(c(0, 30, 60, 90), 3))    sams <- sams[sams < 90]    set.seed(654)    out <- list()    for (i in 1:10) {        out[[i]] <- spread2(a, spreadProbRel = sp, spreadProb = 1,             iterations = 1, start = sams, neighProbs = c(1),             asRaster = FALSE)    }    out <- rbindlist(out)[state == "activeSource"]    uniquePixels <- out[, list(uniquePix = unique(pixels)), by = "initialPixels"]    avail <- table(sp[uniquePixels$uniquePix])    actual <- unname(table(sp[out$pixels]))    relProbs <- spreadProbOptions/sum(spreadProbOptions)    aa <- rmultinom(1, size = 10000, prob = relProbs)[, 1] *         unname(avail)    suppressWarnings(cht <- chisq.test(x = cbind(aa, actual)))    expect_true(cht$p.value > 0.05)    print("Scales with number of starts, not maxSize of raster")    set.seed(21)    b <- raster(extent(0, 10, 0, 10), res = 1)    bProb <- gaussMap(b, speedup = 1)    set.seed(1232)    out <- spread2(spreadProb = 0.5, landscape = b, asRaster = FALSE,         start = ncell(b)/2 - ncol(b)/2, spreadProbRel = bProb,         returnFrom = TRUE, neighProbs = c(0.3, 0.7), exactSize = 30)    set(out, NULL, "relProb", bProb[][out$pixels])    out    if (interactive())         print("check wide range of spreadProbs and that it makes a RasterLayer")    set.seed(654)    rasts <- list()    for (i in 1:20) {        rasts[[i]] <- spread2(a, spreadProb = stats::runif(1,             0, 1))        expect_that(rasts[[i]], is_a("RasterLayer"))    }    if (interactive()) {        names(rasts) <- paste0("ras", 1:20)        clearPlot()        Plot(rasts)    }    if (interactive())         print("testing iterative calling of spread2")    set.seed(299)    sams <- sample(innerCells, 2)    set.seed(299)    out <- spread2(a, iterations = 1, start = sams, asRaster = FALSE)    stillActive <- TRUE    while (stillActive) {        stillActive <- any(out$state == "activeSource")        out <- spread2(a, iterations = 1, start = out, asRaster = FALSE)    }    set.seed(299)    out2 <- spread2(a, start = sams, asRaster = FALSE)    keyedCols <- c("initialPixels", "pixels")    expect_equivalent(out2, out)    if (interactive())         print("testing iterative calling of spread2, but asRaster = TRUE")    set.seed(299)    sams <- sample(innerCells, 2)    set.seed(299)    out1 <- spread2(a, iterations = 1, start = sams, asRaster = TRUE)    stillActive <- TRUE    while (stillActive) {        stillActive <- any(attr(out1, "pixel")$state == "activeSource")        out1 <- spread2(a, iterations = 1, start = out1, asRaster = TRUE)    }    expect_true(identical(out, attr(out1, "pixel")))    if (interactive())         print("testing iterative with maxSize")    set.seed(299)    seed <- sample(1e+06, 1)    set.seed(seed)    sams <- sample(innerCells, 2)    exactSizes <- 5:6    out <- spread2(a, start = sams, spreadProb = 0.225, iterations = 1,         exactSize = exactSizes, asRaster = FALSE)    for (i in 1:20) {        out <- spread2(a, start = out, spreadProb = 0.225, iterations = 1,             exactSize = exactSizes, asRaster = FALSE)    }    if (interactive())         print("testing iterative with maxSize -- where needRetry occurs")    set.seed(299)    sams <- sample(innerCells, 2)    exactSizes <- 60:61    out <- spread2(a, start = sams, spreadProb = 0.225, iterations = 1,         exactSize = exactSizes, asRaster = FALSE)    out2 <- spread2(a, start = sams, spreadProb = 0.225, iterations = 1,         exactSize = exactSizes, asRaster = FALSE)    for (i in 1:25) {        out <- spread2(a, start = out, spreadProb = 0.225, iterations = 1,             exactSize = exactSizes, asRaster = FALSE)        attr(out2, "spreadState") <- NULL        out2 <- spread2(a, start = out2, spreadProb = 0.225,             iterations = 1, exactSize = exactSizes, asRaster = FALSE)    }    expect_true(is.data.table(out))    expect_true(is.data.table(out2))    expect_true(all(attr(out2, "spreadState")$clusterDT$numRetries ==         0))    expect_true(all(attr(out, "spreadState")$clusterDT$numRetries >         10))    expect_true(all(attr(out, "spreadState")$clusterDT$numRetries >         attr(out2, "spreadState")$clusterDT$numRetries))    sams <- c(25, 75)    set.seed(234)    out <- spread2(a, start = sams, spreadProb = 0.225, iterations = 1,         exactSize = exactSizes, asRaster = FALSE)    set.seed(234)    out2 <- spread2(a, start = sams, spreadProb = 0.225, iterations = 1,         exactSize = exactSizes, asRaster = FALSE)    for (i in 1:4) {        set.seed(234)        out <- spread2(a, start = out, spreadProb = 0.225, iterations = 1,             exactSize = exactSizes, asRaster = FALSE)        attr(out2, "spreadState") <- NULL        set.seed(234)        out2 <- spread2(a, start = out2, spreadProb = 0.225,             iterations = 1, exactSize = exactSizes, asRaster = FALSE)    }    expect_identical(data.table(out2), data.table(out))    for (i in 1:25) {        set.seed(234)        out <- spread2(a, start = out, spreadProb = 0.225, iterations = 1,             exactSize = exactSizes, asRaster = FALSE)        attr(out2, "spreadState") <- NULL        set.seed(234)        out2 <- spread2(a, start = out2, spreadProb = 0.225,             iterations = 1, exactSize = exactSizes, asRaster = FALSE)    }    expect_false(identical(data.table(out2), data.table(out)))    skip("benchmarking spread2")    exactSizes <- 60:61    microbenchmark(times = 10, a = {        out <- spread2(a, start = sams, spreadProb = 0.225, iterations = 1,             exactSize = exactSizes, asRaster = FALSE)        for (i in 1:25) {            out <- spread2(a, start = out, spreadProb = 0.225,                 iterations = 1, exactSize = exactSizes, asRaster = FALSE)        }    }, b = {        out2 <- spread2(a, start = sams, spreadProb = 0.225,             iterations = 1, exactSize = exactSizes, asRaster = FALSE)        for (i in 1:25) {            attr(out2, "spreadState") <- NULL            out2 <- spread2(a, start = out2, spreadProb = 0.225,                 iterations = 1, exactSize = exactSizes, asRaster = FALSE)        }    })    a <- raster(extent(0, 1000, 0, 1000), res = 1)    set.seed(123)    sams <- sample(innerCells, 30)    set.seed(123)    profvis::profvis({        out <- spread2(a, start = sams, spreadProb = 0.235, asRaster = FALSE)    })    set.seed(123)    profvis::profvis({        out <- spread2(a, start = sams, spreadProb = 0.235, asRaster = FALSE,             allowOverlap = TRUE)    })    set.seed(123)    microbenchmark(times = 30, {        out1 <- spread2(a, start = sams, spreadProb = 0.235,             asRaster = FALSE)    }, b = {        out2 <- spread(a, loci = sams, spreadProb = 0.235, id = TRUE)    }, c = {        out2 <- spread(a, loci = sams, spreadProb = 0.235, id = TRUE,             lowMemory = TRUE)    })    set.seed(123)    profvis::profvis({        out <- spread2(a, start = sams, spreadProb = 0.235, asRaster = FALSE,             allowOverlap = TRUE)    })    iterativeFun <- function(a, skipChecks, n, sp) {        sams <- sample(innerCells, n)        out <- spread2(a, iterations = 1, start = sams, skipChecks = skipChecks,             asRaster = FALSE, spreadProb = sp)        stillActive <- TRUE        while (stillActive) {            stillActive <- any(out$state == "activeSource")            out <- spread2(a, spreadProb = sp, iterations = 1,                 start = out, asRaster = FALSE, skipChecks = skipChecks)        }        out    }    nonIterativeFun <- function(a, skipChecks, n, sp) {        sams <- sample(innerCells, n)        out <- spread2(a, start = sams, asRaster = FALSE, skipChecks = skipChecks,             spreadProb = sp)        out    }    origSpread <- function(a, quick, n, sp) {        sams <- sample(innerCells, n)        out <- spread(a, spreadProb = sp, loci = sams, id = TRUE,             returnIndices = TRUE, quick = quick)        out    }    origSpreadIterations <- function(a, quick, n, sp) {        sams <- sample(innerCells, n)        out <- spread(a, spreadProb = sp, iterations = 1, loci = sams,             returnIndices = TRUE)        stillActive <- TRUE        while (stillActive) {            stillActive <- any(out$active)            out <- spread(a, spreadProb = sp, iterations = 1,                 spreadState = out, returnIndices = TRUE, quick = quick)        }        out    }    n <- 2    ras <- raster(extent(0, 160, 0, 160), res = 1)    n <- 2000    ras <- raster(extent(0, 6000, 0, 6000), res = 1)    sp <- 0.225    b <- raster(ras)    b[] <- 1    bb <- focal(b, matrix(1/9, nrow = 3, ncol = 3), fun = sum,         pad = TRUE, padValue = 0)    innerCells <- which(bb[] %==% 1)    microbenchmark(times = 3, iterativeFun(ras, TRUE, n, sp),         nonIterativeFun(ras, TRUE, n, sp), origSpread(ras, TRUE,             n, sp), origSpreadIterations(ras, TRUE, n, sp))    microbenchmark(times = 100, iterativeFun(ras, FALSE, n, sp),         nonIterativeFun(ras, FALSE, n, sp), origSpread(ras, FALSE,             n, sp), origSpreadIterations(ras, FALSE, n, sp))    profvis::profvis({        set.seed(3451)        for (i in 1:8) iterativeFun(ras, TRUE, n, sp = sp)    })    profvis::profvis({        nonIterativeFun()    })    library(raster)    library(data.table)    library(fpCompare)    n <- 2    ras <- raster(extent(0, 160, 0, 160), res = 1)    sp <- 0.225    b <- raster(ras)    b[] <- 1    bb <- focal(b, matrix(1/9, nrow = 3, ncol = 3), fun = sum,         pad = TRUE, padValue = 0)    innerCells <- which(bb[] %==% 1)    iterativeNeigh <- function(a, skipChecks, n, sp, exactSizes,         neighProbs, ...) {        sams <- sample(innerCells, n)        out <- spread2(a, iterations = 1, spreadProb = sp, start = sort(sams),             neighProbs = neighProbs, exactSize = exactSizes,             skipChecks = skipChecks, asRaster = FALSE, ...)        stillActive <- TRUE        while (stillActive) {            out <- spread2(a, iterations = 1, spreadProb = sp,                 start = out, neighProbs = neighProbs, exactSize = exactSizes,                 skipChecks = skipChecks, asRaster = FALSE, ...)            stillActive <- any(length(attr(out, "spreadState")$whActive) |                 length(attr(out, "spreadState")$whNeedRetry))        }        out    }    origSpreadIterationsNeighs <- function(a, quick, n, sp, neighProbs,         exactSize) {        sams <- sample(innerCells, n)        out <- spread(a, spreadProb = sp, neighProbs = neighProbs,             iterations = 1, loci = sams, exactSizes = TRUE, returnIndices = TRUE,             maxSize = exactSize)        stillActive <- TRUE        while (stillActive) {            stillActive <- any(out$active)            out <- spread(a, spreadProb = sp, iterations = 1,                 neighProbs = neighProbs, spreadState = out, maxSize = exactSize,                 exactSizes = TRUE, returnIndices = TRUE, quick = quick)        }        out    }    sp <- randomPolygons(ras, numTypes = 35)    sp[] <- (sp[]%%5 + 1)/10    exactSizes <- c(123, 2240)    neighProbs <- c(0.5, 0.3, 0.2)    microbenchmark(times = 9, a = {        iterativeNeigh(ras, TRUE, length(exactSizes), sp = sp,             exactSize = exactSizes, neighProbs = neighProbs)    }, b = {        origSpreadIterationsNeighs(ras, TRUE, length(exactSizes),             sp = sp, exactSize = exactSizes, neighProbs = neighProbs)    })    profvis::profvis({        for (i in 1:5) {            iterativeNeigh(ras, TRUE, length(exactSizes), sp = sp,                 exactSize = exactSizes, neighProbs = neighProbs)        }    })    profvis::profvis({        for (i in 1:5) {            origSpreadIterationsNeighs(ras, TRUE, length(exactSizes),                 sp = sp, exactSize = exactSizes, neighProbs = neighProbs)        }    })    dev()    iterativeNeigh(ras, TRUE, length(exactSizes), sp = sp, exactSize = exactSizes,         plot.it = TRUE)    iterativeNeigh(ras, TRUE, length(exactSizes), sp = sp)    iterativeNeigh(ras, TRUE, length(exactSizes), sp = sp)    nn <- 1000    outNew <- out <- numeric(nn)    for (i in 1:nn) {        outNew[i] <- NROW(nonIterativeFun(ras, TRUE, n, sp))        out[i] <- NROW(origSpread(ras, TRUE, n, sp))    }    out <- data.table(x = out)    outNew <- data.table(x = outNew)    mean(out$x)    mean(outNew$x)    sd(out$x)    sd(outNew$x)    n <- 5    ras <- raster(extent(0, 1000, 0, 1000), res = 1)    sp <- 0.295    set.seed(123)    microbenchmark(times = 100, nonIterativeFun(ras, TRUE, n,         sp))})
  17: eval(code, test_env)
  18: eval(code, test_env)
  19: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
  20: doTryCatch(return(expr), name, parentenv, handler)
  21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  23: doTryCatch(return(expr), name, parentenv, handler)
  24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  25: tryCatchList(expr, classes, parentenv, handlers)
  26: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  27: test_code(NULL, exprs, env)
  28: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  29: force(code)
  30: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,     {        lister$start_file(basename(path))        source_file(path, new.env(parent = env), chdir = TRUE,             wrap = wrap)        end_context()    })
  31: FUN(X[[i]], ...)
  32: lapply(paths, test_file, env = env, reporter = current_reporter,     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  33: force(code)
  34: with_reporter(reporter = current_reporter, results <- lapply(paths,     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,     load_helpers = FALSE, wrap = wrap))
  35: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  36: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     wrap = wrap)
  37: test_package_dir(package = package, test_path = test_path, filter = filter,     reporter = reporter, ..., stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  38: test_check("SpaDES.tools")
  An irrecoverable exception occurred. R is aborting now ...