Running 'testthat.R' [66s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(BayesPostEst)
  > 
  > test_check("BayesPostEst")
  Loading required package: rjags
  Loading required package: coda
  Linked to JAGS 4.3.1
  Loaded modules: basemod,bugs
  
  Attaching package: 'R2jags'
  
  The following object is masked from 'package:coda':
  
      traceplot
  
  Loading required package: Rcpp
  Loading 'brms' package (version 2.23.0). Useful instructions
  can be found by typing help('brms'). A more detailed introduction
  to the package is available through vignette('brms_overview').
  
  Attaching package: 'brms'
  
  The following object is masked from 'package:stats':
  
      ar
  
  Compiling Stan program...
  specified C++17
  make cmd is
    make -f "D:/RCompile/recent/R/etc/x64/Makeconf" -f "D:/RCompile/recent/R/share/make/winshlib.mk" CXX='$(CXX17) $(CXX17STD)' CXXFLAGS='$(CXX17FLAGS)' CXXPICFLAGS='$(CXX17PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX17LDFLAGS)' SHLIB_LD='$(SHLIB_CXX17LD)' SHLIB="file10fc85d8c4c3f.dll" WIN=64 TCLBIN= OBJECTS="file10fc85d8c4c3f.o"
  
  make would use
  make[1]: Entering directory '/d/temp/2026_04_17_01_50_00_1722/Rtmp0YkyHE'
  g++  -std=gnu++17 -I"D:/RCompile/recent/R/include" -DNDEBUG   -I"D:/RCompile/CRANpkg/lib/4.6/Rcpp/include/"  -I"D:/temp/2026_04_17_01_50_00_1722/RtmpeCHN11/RLIBS_928814d51cdc/RcppEigen/include/"  -I"D:/temp/2026_04_17_01_50_00_1722/RtmpeCHN11/RLIBS_928814d51cdc/RcppEigen/include/unsupported"  -I"D:/temp/2026_04_17_01_50_00_1722/RtmpeCHN11/RLIBS_928814d51cdc/BH/include" -I"D:/RCompile/CRANpkg/lib/4.6/StanHeaders/include/src/"  -I"D:/RCompile/CRANpkg/lib/4.6/StanHeaders/include/"  -I"D:/RCompile/CRANpkg/lib/4.6/RcppParallel/include/" -DRCPP_PARALLEL_USE_TBB=1 -I"D:/RCompile/CRANpkg/lib/4.6/rstan/include" -DEIGEN_NO_DEBUG  -DBOOST_DISABLE_ASSERTS  -DBOOST_PENDING_INTEGER_LOG2_HPP  -DSTAN_THREADS  -DUSE_STANC3 -DSTRICT_R_HEADERS  -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION  -D_HAS_AUTO_PTR_ETC=0  -include "D:/RCompile/CRANpkg/lib/4.6/StanHeaders/include/stan/math/prim/fun/Eigen.hpp"  -std=c++1y    -I"d:/rtools45/x86_64-w64-mingw32.static.posix/include"      -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign    -c file10fc85d8c4c3f.cpp -o file10fc85d8c4c3f.o
  if test "zfile10fc85d8c4c3f.o" != "z"; then \
    if test -e "file10fc85d8c4c3f-win.def"; then \
      echo g++   -shared  -s -static-libgcc -o file10fc85d8c4c3f.dll file10fc85d8c4c3f-win.def file10fc85d8c4c3f.o  "D:/RCompile/CRANpkg/lib/4.6/rstan/lib/x64/libStanServices.a" -L"D:/RCompile/CRANpkg/lib/4.6/StanHeaders/libs/x64" -lStanHeaders -L"D:/RCompile/CRANpkg/lib/4.6/RcppParallel/lib/x64" -ltbb -L"D:/RCompile/CRANpkg/lib/4.6/RcppParallel/libs/x64" -lRcppParallel -LD:/RCompile/CRANpkg/lib/4.6/RcppParallel/lib/x64 -ltbb -ltbbmalloc -L"d:/rtools45/x86_64-w64-mingw32.static.posix/lib/x64" -L"d:/rtools45/x86_64-w64-mingw32.static.posix/lib"  -L"D:/RCompile/recent/R/bin/x64" -lR ; \
      g++   -shared  -s -static-libgcc -o file10fc85d8c4c3f.dll file10fc85d8c4c3f-win.def file10fc85d8c4c3f.o  "D:/RCompile/CRANpkg/lib/4.6/rstan/lib/x64/libStanServices.a" -L"D:/RCompile/CRANpkg/lib/4.6/StanHeaders/libs/x64" -lStanHeaders -L"D:/RCompile/CRANpkg/lib/4.6/RcppParallel/lib/x64" -ltbb -L"D:/RCompile/CRANpkg/lib/4.6/RcppParallel/libs/x64" -lRcppParallel -LD:/RCompile/CRANpkg/lib/4.6/RcppParallel/lib/x64 -ltbb -ltbbmalloc -L"d:/rtools45/x86_64-w64-mingw32.static.posix/lib/x64" -L"d:/rtools45/x86_64-w64-mingw32.static.posix/lib"  -L"D:/RCompile/recent/R/bin/x64" -lR ; \
    else \
      echo EXPORTS > tmp.def; \
      nm file10fc85d8c4c3f.o | sed -n 's/^.* [BCDRT] / /p' | sed -e '/[.]refptr[.]/d' -e '/[.]weak[.]/d' | sed 's/[^ ][^ ]*/"&"/g'  >> tmp.def; \
      echo g++   -shared  -s -static-libgcc -o file10fc85d8c4c3f.dll tmp.def file10fc85d8c4c3f.o  "D:/RCompile/CRANpkg/lib/4.6/rstan/lib/x64/libStanServices.a" -L"D:/RCompile/CRANpkg/lib/4.6/StanHeaders/libs/x64" -lStanHeaders -L"D:/RCompile/CRANpkg/lib/4.6/RcppParallel/lib/x64" -ltbb -L"D:/RCompile/CRANpkg/lib/4.6/RcppParallel/libs/x64" -lRcppParallel -LD:/RCompile/CRANpkg/lib/4.6/RcppParallel/lib/x64 -ltbb -ltbbmalloc -L"d:/rtools45/x86_64-w64-mingw32.static.posix/lib/x64" -L"d:/rtools45/x86_64-w64-mingw32.static.posix/lib"  -L"D:/RCompile/recent/R/bin/x64" -lR ; \
      g++   -shared  -s -static-libgcc -o file10fc85d8c4c3f.dll tmp.def file10fc85d8c4c3f.o  "D:/RCompile/CRANpkg/lib/4.6/rstan/lib/x64/libStanServices.a" -L"D:/RCompile/CRANpkg/lib/4.6/StanHeaders/libs/x64" -lStanHeaders -L"D:/RCompile/CRANpkg/lib/4.6/RcppParallel/lib/x64" -ltbb -L"D:/RCompile/CRANpkg/lib/4.6/RcppParallel/libs/x64" -lRcppParallel -LD:/RCompile/CRANpkg/lib/4.6/RcppParallel/lib/x64 -ltbb -ltbbmalloc -L"d:/rtools45/x86_64-w64-mingw32.static.posix/lib/x64" -L"d:/rtools45/x86_64-w64-mingw32.static.posix/lib"  -L"D:/RCompile/recent/R/bin/x64" -lR ; \
      rm -f tmp.def; \
    fi \
  fi
  make[1]: Leaving directory '/d/temp/2026_04_17_01_50_00_1722/Rtmp0YkyHE'
  Error in `source_dir()`:
  ! Failed to evaluate './setup.R'.
  Caused by error in `compileCode()`:
  ! del = model10fc84bf392e__namespace::model10fc84bf392e_; BaseRNG = boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014, 0, 2147483563>, boost::random::linear_congruential_engine<unsigned int, 40692, 0, 2147483399> >]'
     22 |     return 0.5 * z.p.transpose() * z.inv_e_metric_ * z.p;
  D:/RCompile/CRANpkg/lib/4.6/StanHeaders/include/src/stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp:21:0:   required from here
     21 |   double T(dense_e_point& z) {
  D:/RCompile/CRANpkg/lib/4.6/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:654:74: warning: ignoring attributes on template argument 'Eigen::internal::packet_traits<double>::type' {aka '__m128d'} [-Wignored-attributes]
    654 |   return internal::first_aligned<int(unpacket_traits<DefaultPacketType>::alignment),Derived>(m);
        |                                                                          ^~~~~~~~~
  make[1]: *** [D:/RCompile/recent/R/etc/x64/Makeconf:304: file10fc85d8c4c3f.o] Error 1
  Backtrace:
       ▆
    1. ├─testthat::test_check("BayesPostEst")
    2. │ └─testthat::test_dir(...)
    3. │   └─testthat:::test_files(...)
    4. │     └─testthat:::test_files_serial(...)
    5. │       └─testthat:::test_files_setup_state(...)
    6. │         └─testthat::source_test_setup(".", env)
    7. │           └─testthat::source_dir(path, "^setup.*\\.[rR]$", env = env, wrap = FALSE)
    8. │             └─base::lapply(...)
    9. │               └─testthat (local) FUN(X[[i]], ...)
   10. │                 └─testthat::source_file(...)
   11. │                   ├─base::withCallingHandlers(...)
   12. │                   └─base::eval(exprs, env)
   13. │                     └─base::eval(exprs, env)
   14. │                       └─base::lapply(r_scripts, source) at ./setup.R:24:1
   15. │                         └─base (local) FUN(X[[i]], ...)
   16. │                           ├─base::withVisible(eval(ei, envir))
   17. │                           └─base::eval(ei, envir)
   18. │                             └─base::eval(ei, envir)
   19. ├─brms::brm(...)
   20. │ └─brms::do_call(compile_model, compile_args)
   21. │   └─brms:::eval2(call, envir = args, enclos = envir)
   22. │     └─base::eval(expr, envir, ...)
   23. │       └─base::eval(expr, envir, ...)
   24. │         └─brms (local) .fun(...)
   25. │           └─brms (local) .compile_model(model, ...)
   26. │             ├─brms:::eval_silent(...)
   27. │             │ └─base::eval(expr, envir)
   28. │             │   └─base::eval(expr, envir)
   29. │             └─brms::do_call(rstan::stan_model, args)
   30. │               └─brms:::eval2(call, envir = args, enclos = envir)
   31. │                 └─base::eval(expr, envir, ...)
   32. │                   └─base::eval(expr, envir, ...)
   33. │                     └─rstan (local) .fun(model_code = .x1)
   34. │                       └─rstan:::cxxfunctionplus(...)
   35. │                         ├─pkgbuild::with_build_tools(...)
   36. │                         │ └─pkgbuild:::withr_with_path(rtools_path(), code)
   37. │                         │   └─base::force(code)
   38. │                         └─inline::cxxfunction(...)
   39. │                           └─inline:::compileCode(f, code, language = language, verbose = verbose)
   40. │                             └─base::stop(...)
   41. └─base::.handleSimpleError(...)
   42.   └─testthat (local) h(simpleError(msg, call))
   43.     └─cli::cli_abort(...)
   44.       └─rlang::abort(...)
  Error in `source_dir()`:
  ! Failed to evaluate './setup.R'.
  Caused by error in `sink()`:
  ! invalid connection
  Backtrace:
       ▆
    1. ├─testthat::test_check("BayesPostEst")
    2. │ └─testthat::test_dir(...)
    3. │   └─testthat:::test_files(...)
    4. │     └─testthat:::test_files_serial(...)
    5. │       └─testthat:::test_files_setup_state(...)
    6. │         └─testthat::source_test_setup(".", env)
    7. │           └─testthat::source_dir(path, "^setup.*\\.[rR]$", env = env, wrap = FALSE)
    8. │             └─base::lapply(...)
    9. │               └─testthat (local) FUN(X[[i]], ...)
   10. │                 └─testthat::source_file(...)
   11. │                   ├─base::withCallingHandlers(...)
   12. │                   └─base::eval(exprs, env)
   13. │                     └─base::eval(exprs, env)
   14. │                       └─base::lapply(r_scripts, source) at ./setup.R:24:1
   15. │                         └─base (local) FUN(X[[i]], ...)
   16. │                           ├─base::withVisible(eval(ei, envir))
   17. │                           └─base::eval(ei, envir)
   18. │                             └─base::eval(ei, envir)
   19. ├─brms::brm(...)
   20. │ └─brms::do_call(compile_model, compile_args)
   21. │   └─brms:::eval2(call, envir = args, enclos = envir)
   22. │     └─base::eval(expr, envir, ...)
   23. │       └─base::eval(expr, envir, ...)
   24. │         └─brms (local) .fun(...)
   25. │           └─brms (local) .compile_model(model, ...)
   26. │             ├─brms:::eval_silent(...)
   27. │             │ └─base::eval(expr, envir)
   28. │             │   └─base::eval(expr, envir)
   29. │             └─brms::do_call(rstan::stan_model, args)
   30. │               └─brms:::eval2(call, envir = args, enclos = envir)
   31. │                 └─base::eval(expr, envir, ...)
   32. │                   └─base::eval(expr, envir, ...)
   33. │                     └─rstan (local) .fun(model_code = .x1)
   34. │                       └─rstan:::cxxfunctionplus(...)
   35. │                         └─base::sink(type = "output")
   36. └─base::.handleSimpleError(`<fn>`, "invalid connection", base::quote(sink(type = "output")))
   37.   └─testthat (local) h(simpleError(msg, call))
   38.     └─cli::cli_abort(...)
   39.       └─rlang::abort(...)
  Execution halted