Running 'doRUnit.R' [7s/9s]
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: 0x48f1658>
  <environment: namespace:rstan>
   --- function search by body ---
  Function extract_sparse_parts in namespace rstan has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Timing stopped at: 3.672 0.382 5.028
  Error in if (class(A) == "matrix") A <- Matrix::Matrix(A, sparse = TRUE) : 
    the condition has length > 1
   done successfully.
  
  
  
  Executing test function test_config_argss  ... Error in rstan:::config_argss(3, 100, 10, 3, "random", 10, NA, algorithm = "NUTS",  : 
    chain_id has duplicated elements
  Error in check_seed(seed) : seed needs to be string of digits
  Error in check_seed(seed) : seed needs to be string of digits
   done successfully.
  
  
  
  Executing test function test_data_list2array  ...  done successfully.
  
  
  
  Executing test function test_data_preprocess  ... Error in FUN(X[[i]], ...) : Stan does not support NA (in f) in data
  In addition: Warning message:
  In FUN(X[[i]], ...) : data with name h is not numeric and not used
   done successfully.
  
  
  
  Executing test function test_data_preprocess2  ... Error in data_list2array(x) : all elements of the list should be numeric
   done successfully.
  
  
  
  Executing test function test_dotfnames_fromto_sqrfnames  ...  done successfully.
  
  
  
  Executing test function test_flatnames  ...  done successfully.
  
  
  
  Executing test function test_get_dims_from_fnames  ...  done successfully.
  
  
  
  Executing test function test_get_model_strcode  ... Error in rstan:::get_model_strcode() : 
    model file missing and empty model_code
  In addition: Warning messages:
  1: In readLines(file, warn = TRUE) :
    incomplete final line found on 'tmp.stan'
  2: In readLines(file, warn = TRUE) :
    incomplete final line found on 'tmp.stan'
   done successfully.
  
  
  
  Executing test function test_idx_col2rowm  ...  done successfully.
  
  
  
  Executing test function test_idx_row2colm  ...  done successfully.
  
  
  
  Executing test function test_is_named_list  ...  done successfully.
  
  
  
  Executing test function test_is_valid_stan_name  ...  done successfully.
  
  
  
  Executing test function test_mklist  ... Error in rstan:::mklist(c("x", "f")) : 
    objects 'f' of mode numeric and list not found
   done successfully.
  
  
  
  Executing test function test_multi_idx_row2colm  ...  done successfully.
  
  
  
  Executing test function test_par_vector2list  ...  done successfully.
  
  
  
  Executing test function test_pars_total_indexes  ...  done successfully.
  
  
  
  Executing test function test_read_comments  ...  done successfully.
  
  
  
  Executing test function test_read_csv_header  ...  done successfully.
  
  
  
  Executing test function test_read_rdump  ...  done successfully.
  
  
  
  Executing test function test_remove_empty_pars  ...  done successfully.
  
  
  
  Executing test function test_seq_array_ind  ...  done successfully.
  
  
  
  Executing test function test_stan_rdump  ...  done successfully.
  
  
  
  Executing test function test_options1  ...  done successfully.
  
  
  
  Executing test function test_options2  ...  done successfully.
  
  
  
  Executing test function test_plot_rhat_breaks  ...  done successfully.
  
  
  
  Executing test function test_rstan_options  ...  done successfully.
  
  
  
  Executing test function test_paridx_fun  ...  done successfully.
  
  
  
  Executing test function test_parse_stancsv_comments3  ...  done successfully.
  
  
  > printTextProtocol(testsres, showDetails = TRUE)
  RUNIT TEST PROTOCOL -- Fri Jan 31 02:27:39 2020 
  *********************************************** 
  Number of test functions: 32 
  Number of errors: 1 
  Number of failures: 0 
  
   
  1 Test Suite : 
  rstantest - 32 test functions, 1 error, 0 failures
  ERROR in test_extract_sparse_parts: Error in if (class(A) == "matrix") A <- Matrix::Matrix(A, sparse = TRUE) : 
    the condition has length > 1
  
  
  
  Details 
  *************************** 
  Test Suite: rstantest 
  Test function regexp: ^test_+ 
  Test file regexp: ^runit.+\.R 
  Involved directory: 
  /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/rstan/unitTests 
  --------------------------- 
  Test file: /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/rstan/unitTests/runit.test.chains.R 
  test_ess2: (1 checks) ... OK (0 seconds)
  test_essnrhat: (4 checks) ... OK (0.2 seconds)
  test_seq_perm: (4 checks) ... OK (0 seconds)
  --------------------------- 
  Test file: /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/rstan/unitTests/runit.test.extract_sparse_parts.R 
  test_extract_sparse_parts: ERROR !! 
  Error in if (class(A) == "matrix") A <- Matrix::Matrix(A, sparse = TRUE) : 
    the condition has length > 1
  --------------------------- 
  Test file: /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/rstan/unitTests/runit.test.misc.R 
  test_config_argss: (13 checks) ... OK (0 seconds)
  test_data_list2array: (9 checks) ... OK (0 seconds)
  test_data_preprocess: (5 checks) ... OK (0 seconds)
  test_data_preprocess2: (6 checks) ... OK (0 seconds)
  test_dotfnames_fromto_sqrfnames: (1 checks) ... OK (0 seconds)
  test_flatnames: (2 checks) ... OK (0 seconds)
  test_get_dims_from_fnames: (1 checks) ... OK (0.03 seconds)
  test_get_model_strcode: (11 checks) ... OK (0 seconds)
  test_idx_col2rowm: (3 checks) ... OK (0 seconds)
  test_idx_row2colm: (3 checks) ... OK (0 seconds)
  test_is_named_list: (4 checks) ... OK (0 seconds)
  test_is_valid_stan_name: (5 checks) ... OK (0 seconds)
  test_mklist: (5 checks) ... OK (0 seconds)
  test_multi_idx_row2colm: (3 checks) ... OK (0 seconds)
  test_par_vector2list: (5 checks) ... OK (0 seconds)
  test_pars_total_indexes: (6 checks) ... OK (0.02 seconds)
  test_read_comments: (4 checks) ... OK (0 seconds)
  test_read_csv_header: (2 checks) ... OK (0 seconds)
  test_read_rdump: (3 checks) ... OK (0 seconds)
  test_remove_empty_pars: (4 checks) ... OK (0 seconds)
  test_seq_array_ind: (4 checks) ... OK (0 seconds)
  test_stan_rdump: (8 checks) ... OK (0 seconds)
  --------------------------- 
  Test file: /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/rstan/unitTests/runit.test.options.R 
  test_options1: (2 checks) ... OK (0 seconds)
  test_options2: (7 checks) ... OK (0 seconds)
  test_plot_rhat_breaks: (2 checks) ... OK (0 seconds)
  test_rstan_options: (0 checks) ... OK (0 seconds)
  --------------------------- 
  Test file: /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/rstan/unitTests/runit.test.stan_csv.R 
  test_paridx_fun: (3 checks) ... OK (0 seconds)
  test_parse_stancsv_comments3: (6 checks) ... OK (0 seconds)
  
  > printTextProtocol(testsres, showDetails = TRUE, fileName = paste(reportfile, 
  +     ".txt", sep = ""))
  
  > printHTMLProtocol(testsres, fileName = paste(reportfile, 
  +     ".html", sep = ""))
  
  > tmp <- getErrors(testsres)
  
  > if (tmp$nFail > 0 | tmp$nErr > 0) {
  +     stop(paste("\n\nUnit testing failed (#test failures: ", tmp$nFail, 
  +         ", #R errors: ", tmp$nErr, " ..." ... [TRUNCATED] 
  Error in eval(ei, envir) : 
  
  Unit testing failed (#test failures: 0, #R errors: 1)
  
  Calls: source -> withVisible -> eval -> eval
  In addition: Warning messages:
  1: In (function (x)  : rstan option 'c' not found
  2: In (function (x)  : rstan option 'c' not found
  Execution halted