Is it possible to call a debugger in RStudio when running testthat tests? I was not able to find an installation that allows this (various combinations of "use the functions of the devtools package, if available" in the settings, clicking "Test package" in the menu "Create → Advanced", running test() in the console, inserting calls to browser() , etc.), but have not yet found a way.
I am also very much lost in testing, not knowing whether the code was run in the system libraries (by creating "Build and Reload") or is running in place from the local R directory, or something - sometimes RStudio complains that the breakpoint is not can be installed until the package is restored (so I suspect the first one) or not (so I suspect the last one). Not sure if this question is closely related or not related to my main question.
Finding no way to get into the debugger, I end up inserting the test code into the console and working in a very special way, and basically remove the TDD habits in the leg. Therefore, any advice will be appreciated - if it is not possible to call the debugger, any suggested workarounds?
I am running RStudio version 0.99.447 on OS X, in local mode, with R 3.2.1.
Change I would also like to know more about the options, for example. "option X will never support debugging because it works in a forked process, try using another option Y instead."
Refresh - without replying here, I also asked https://support.rstudio.com/hc/communities/public/questions/204779797-Debugging-testthat-tests-in-RStudio (where I also found “t were the answers).
debugging r testing rstudio testthat
Ken williams
source share