Running ‘testthat.R’ [10s/16s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(rstantools)
  This is rstantools version 1.5.0
  > 
  > foo <- function(x) {"test function"}
  > 
  > test_check("rstantools")
  Changing active project to testPackage
  ✔ Creating 'R/'
  ✔ Creating 'man/'
  ✔ Writing 'DESCRIPTION'
  ✔ Writing 'NAMESPACE'
  ✔ Creating 'tools/'
  ✔ Creating 'src/'
  ✔ Creating 'src/stan_files/'
  ✔ Creating 'src/stan_files/chunks/'
  ✔ Creating 'inst/'
  ✔ Creating 'inst/include/'
  Writing NAMESPACE
  Running /home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/R CMD INSTALL \
    /tmp/RtmpgR7w6j/testPackage \
    '--library=/tmp/RtmpgR7w6j/devtools_install_79cdebcd200' --no-R --no-data \
    --no-help --no-demo --no-inst --no-docs --no-exec --no-multiarch \
    --no-test-load --preclean
  * installing *source* package ‘testPackage’ ...
  ** libs
  make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
  make[1]: Entering directory '/tmp/RtmpgR7w6j/testPackage/src'
  make[1]: Leaving directory '/tmp/RtmpgR7w6j/testPackage/src'
  make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
  make[1]: Entering directory '/tmp/RtmpgR7w6j/testPackage/src'
  "/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript" -e "source(file.path('..', 'tools', 'make_cc.R')); make_cc(commandArgs(TRUE))" stan_files/test.stan
  Wrote C++ file "stan_files/test.cc"
  g++-8  -I"/home/hornik/tmp/R.check/r-patched-gcc/Work/build/include" -DNDEBUG -I"../inst/include" -I"`"/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript" --vanilla -e "cat(system.file('include', 'src', package = 'StanHeaders'))"`" -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -DBOOST_MATH_OVERFLOW_ERROR_POLICY=errno_on_error -I"/tmp/Rtmp7jvfK8/RLIBS_541d30b4481/StanHeaders/include" -I"/tmp/Rtmp7jvfK8/RLIBS_541d30b4481/rstan/include" -I"/tmp/Rtmp7jvfK8/RLIBS_541d30b4481/BH/include" -I"/tmp/Rtmp7jvfK8/RLIBS_541d30b4481/Rcpp/include" -I"/tmp/Rtmp7jvfK8/RLIBS_541d30b4481/RcppEigen/include" -I/usr/local/include   -fpic  -g -O2 -Wall -pedantic -mtune=native  -UNDEBUG -Wall -pedantic -g -Og -c stan_files/test.cc -o stan_files/test.o
  In file included from /tmp/Rtmp7jvfK8/RLIBS_541d30b4481/rstan/include/rstan/rstaninc.hpp:3,
                   from stan_files/test.hpp:18,
                   from stan_files/test.cc:3:
  /tmp/Rtmp7jvfK8/RLIBS_541d30b4481/rstan/include/rstan/stan_fit.hpp:11:10: fatal error: stan/version.hpp: No such file or directory
   #include <stan/version.hpp>
            ^~~~~~~~~~~~~~~~~~
  compilation terminated.
  g++-8  -I"/home/hornik/tmp/R.check/r-patched-gcc/Work/build/include" -DNDEBUG -I"../inst/include" -I"`"/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript" --vanilla -e "cat(system.file('include', 'src', package = 'StanHeaders'))"`" -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -DBOOST_MATH_OVERFLOW_ERROR_POLICY=errno_on_error -I"/tmp/Rtmp7jvfK8/RLIBS_541d30b4481/StanHeaders/include" -I"/tmp/Rtmp7jvfK8/RLIBS_541d30b4481/rstan/include" -I"/tmp/Rtmp7jvfK8/RLIBS_541d30b4481/BH/include" -I"/tmp/Rtmp7jvfK8/RLIBS_541d30b4481/Rcpp/include" -I"/tmp/Rtmp7jvfK8/RLIBS_541d30b4481/RcppEigen/include" -I/usr/local/include   -fpic  -g -O2 -Wall -pedantic -mtune=native  -UNDEBUG -Wall -pedantic -g -Og -c init.cpp -o init.o
  make[1]: *** [/home/hornik/tmp/R.check/r-patched-gcc/Work/build/etc/Makeconf:164: stan_files/test.o] Error 1
  rm stan_files/test.cc
  make[1]: Leaving directory '/tmp/RtmpgR7w6j/testPackage/src'
  make[1]: Target 'all' not remade because of errors.
  ERROR: compilation failed for package ‘testPackage’
  * removing ‘/tmp/RtmpgR7w6j/devtools_install_79cdebcd200/testPackage’
  ── 1. Error: (unknown) (@test-rstan_package_skeleton.R#4)  ─────────────────────
  System command error
  1: rstan_package_skeleton(path = file.path(tempdir(), "testPackage"), stan_files = test_path("test.stan")) at testthat/test-rstan_package_skeleton.R:4
  2: suppressMessages(roxygen2::roxygenise(package.dir = DIR, clean = TRUE))
  3: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  4: roxygen2::roxygenise(package.dir = DIR, clean = TRUE)
  5: load_code(base_path)
  6: pkgload::load_all(path)
  7: pkgbuild::compile_dll(path, quiet = quiet)
  8: withr::with_makevars(compiler_flags(TRUE), assignment = "+=", {
         install_min(path, dest = install_dir, components = "libs", args = if (needs_clean(path)) 
             "--preclean", quiet = quiet)
     })
  9: with_envvar(c(R_MAKEVARS_USER = makevars_file), {
         set_makevars(new, path, makevars_file, assignment = assignment)
         force(code)
     })
  10: force(code)
  ...
  14: with_build_tools(callr::rcmd_safe(..., env = env, spinner = FALSE), required = required)
  15: callr::rcmd_safe(..., env = env, spinner = FALSE)
  16: run_r(options)
  17: with(options, with_envvar(env, run(bin, args = real_cmdargs, stdout_line_callback = real_callback(stdout), 
         stderr_line_callback = real_callback(stderr), stdout_callback = real_block_callback, 
         stderr_callback = real_block_callback, echo_cmd = echo, echo = show, spinner = spinner, 
         error_on_status = fail_on_status, timeout = timeout)))
  18: with.default(options, with_envvar(env, run(bin, args = real_cmdargs, stdout_line_callback = real_callback(stdout), 
         stderr_line_callback = real_callback(stderr), stdout_callback = real_block_callback, 
         stderr_callback = real_block_callback, echo_cmd = echo, echo = show, spinner = spinner, 
         error_on_status = fail_on_status, timeout = timeout)))
  19: eval(substitute(expr), data, enclos = parent.frame())
  20: eval(substitute(expr), data, enclos = parent.frame())
  21: with_envvar(env, run(bin, args = real_cmdargs, stdout_line_callback = real_callback(stdout), 
         stderr_line_callback = real_callback(stderr), stdout_callback = real_block_callback, 
         stderr_callback = real_block_callback, echo_cmd = echo, echo = show, spinner = spinner, 
         error_on_status = fail_on_status, timeout = timeout))
  22: force(code)
  23: run(bin, args = real_cmdargs, stdout_line_callback = real_callback(stdout), stderr_line_callback = real_callback(stderr), 
         stdout_callback = real_block_callback, stderr_callback = real_block_callback, 
         echo_cmd = echo, echo = show, spinner = spinner, error_on_status = fail_on_status, 
         timeout = timeout)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 41 SKIPPED: 0 FAILED: 1
  1. Error: (unknown) (@test-rstan_package_skeleton.R#4) 
  
  Error: testthat unit tests failed
  Execution halted