Running ‘doRUnit.R’ [4s/6s]
Running the tests in ‘tests/doRUnit.R’ failed.
Complete output:
  > 
  > ## unit tests will not be done if RUnit is not available
  > if(!require("RUnit", quietly = TRUE)) {
  +   warning("cannot run unit tests -- package RUnit is not available")
  +   q('no');
  + } 
  > 
  >  
  > pkg <- "rstan" 
  > 
  > path <- system.file(package = pkg, "unitTests")
  > source(file.path(path, "runRunitTests.R"), echo = TRUE)
  
  > pkg <- "rstan"
  
  > if (!require("RUnit", quietly = TRUE)) {
  +     stop("Package Runit is not found.")
  + }
  
  > if (exists("path")) {
  +     reportfile <- file.path(getwd(), "report")
  + } else {
  +     path <- getwd()
  +     reportfile <- file.path(path, "report" .... [TRUNCATED] 
  
  > stopifnot(file.exists(path), file.info(path.expand(path))$isdir)
  
  > library(package = pkg, character.only = TRUE)
  Loading required package: StanHeaders
  Loading required package: ggplot2
  rstan (Version 2.19.2, GitRev: 2e1f913d3ca3)
  For execution on a local, multicore CPU with excess RAM we recommend calling
  options(mc.cores = parallel::detectCores()).
  To avoid recompilation of unchanged Stan programs, we recommend calling
  rstan_options(auto_write = TRUE)
  
  > rstantest <- defineTestSuite("rstantest", dirs = path, 
  +     testFileRegexp = "^runit.+\\.R", testFuncRegexp = "^test_+", 
  +     rngKind = "Marsagl ..." ... [TRUNCATED] 
  
  > testsres <- runTestSuite(rstantest)
  
  
  Executing test function test_ess2  ... Read 34 items
  Read 34 items
   done successfully.
  
  
  
  Executing test function test_essnrhat  ...  done successfully.
  
  
  
  Executing test function test_seq_perm  ...  done successfully.
  
  
  
  Executing test function test_extract_sparse_parts  ... Loading required namespace: Matrix
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  rstan
   --- call from context --- 
  rstan::extract_sparse_parts(A)
   --- call from argument --- 
  if (class(A) == "matrix") A <- Matrix::Matrix(A, sparse = TRUE)
   --- R stacktrace ---
  where 1: rstan::extract_sparse_parts(A)
  where 2: func()
  where 3: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
  where 4: doTryCatch(return(expr), name, parentenv, handler)
  where 5: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 6: tryCatchList(expr, classes, parentenv, handlers)
  where 7: tryCatch(expr, error = function(e) {
      call <- conditionCall(e)
      if (!is.null(call)) {
          if (identical(call[[1L]], quote(doTryCatch))) 
              call <- sys.call(-4L)
          dcall <- deparse(call)[1L]
          prefix <- paste("Error in", dcall, ": ")
          LONG <- 75L
          sm <- strsplit(conditionMessage(e), "\n")[[1L]]
          w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
          if (is.na(w)) 
              w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], 
                  type = "b")
          if (w > LONG) 
              prefix <- paste0(prefix, "\n  ")
      }
      else prefix <- "Error : "
      msg <- paste0(prefix, conditionMessage(e), "\n")
      .Internal(seterrmessage(msg[1L]))
      if (!silent && isTRUE(getOption("show.error.messages"))) {
          cat(msg, file = outFile)
          .Internal(printDeferredWarnings())
      }
      invisible(structure(msg, class = "try-error", condition = e))
  })
  where 8: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
  where 9: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp, 
      tearDownFunc = .tearDown)
  where 10: .sourceTestFile(testFile, testSuite$testFuncRegexp)
  where 11: runTestSuite(rstantest)
  where 12: eval(ei, envir)
  where 13: eval(ei, envir)
  where 14: withVisible(eval(ei, envir))
  where 15: source(file.path(path, "runRunitTests.R"), echo = TRUE)
  
   --- value of length: 2 type: logical ---
  [1]  TRUE FALSE
   --- function from context --- 
  function (A) 
  {
      if (!requireNamespace("Matrix")) 
          stop("You have to install the Matrix package to call 'extract_sparse_parts'")
      if (class(A) == "matrix") 
          A <- Matrix::Matrix(A, sparse = TRUE)
      A <- Matrix::t(A)
      A <- as(A, "dgCMatrix")
      return(.Call(extract_sparse_components, A))
  }
  <bytecode: 0x55e18f0c3ea8>
  <environment: namespace:rstan>
   --- function search by body ---
  Function extract_sparse_parts in namespace rstan has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1