I'm trying to implement testthat
testing of someone else's R code (which was not packaged, when handed off to me).
When I Run Tests
from RStudio, the following happens:
==> Testing R file using 'testthat'
i Loading public.supply.water.losses
i Re-compiling public.supply.water.losses (debug build)
-- R CMD INSTALL ---------------------------------------------------------------
* installing *source* package 'public.supply.water.losses' ...
** using staged installation
** libs
no DLL was created
ERROR: compilation failed for package 'public.supply.water.losses'
* removing 'C:/Users/ashalper/AppData/Local/Temp/1/RtmpEjDWo9/devtools_install_2ec07cae690a/public.supply.water.losses'
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, ...`:
! System command 'Rcmd.exe' failed
---
Exit status: 1
stdout & stderr: <printed>
---
Backtrace:
1. devtools::load_all(dirname("~/src/public-supply-water-losses/tests/testt...
2. pkgload::load_all(path = path, reset = reset, recompile = recompile, ...
3. pkgbuild::compile_dll(path, quiet = quiet)
4. pkgbuild:::install_min(path, dest = install_dir, components = "libs", args = if (ne...
5. pkgbuild::rcmd_build_tools("INSTALL", c(path, paste("--library=", dest, ...
6. pkgbuild::with_build_tools({ ...
7. withr::with_path(rtools_path(), code)
8. base::force(code)
9. base::withCallingHandlers(callr::rcmd_safe(..., env = env, spinner = FALSE, ...
10. callr::rcmd_safe(..., env = env, spinner = FALSE, show = FALSE, ...
11. callr:::run_r(options)
12. base::with(options, with_envvar(env, do.call(processx::run, c(list(bin, ...
13. base::with.default(options, with_envvar(env, do.call(processx::run, ...
14. base::eval(substitute(expr), data, enclos = parent.frame())
15. base::eval(substitute(expr), data, enclos = parent.frame())
16. callr:::with_envvar(env, do.call(processx::run, c(list(bin, args = real_cmdargs,...
17. base::force(code)
18. base::do.call(processx::run, c(list(bin, args = real_cmdargs, stdout_line_call...
19. (function (command = NULL, args = character(), error_on_status = TRUE, ...
20. base::throw(new_process_error(res, call = sys.call(), echo = echo, ...
21. | base::signalCondition(cond)
22. (function (e) ...
23. asNamespace("callr")$err$throw(e)
Execution halted
Exited with status 1.
I'm not an every-day R programmer, so the backtrace (off in R library code?) is fairly inscrutable to me. Can anyone suggest a way to investigate this?
The same error occurs when I run devtools::check()
.
Thanks very much.