I’m developing a package called MyPkg in Juno with the following directory structure:
MyPkg/
- MyPkg.jl
- test/
-- runtests.jl
How do I…
do test-driven development (using MyPkg/test/runtests.jl)
AND
use the Juno debugger to easily debug functions executed by runtests
easily?
I’d like to do both easily from the Juno console, but everything I’ve tried is awkward/broken. Rather than regurgitate all my failed approaches, would someone more experienced please explain how you set up your paths/environment/workflow to accomplish the above? Or if you think I’m asking the wrong question–meaning, there are better ways to test–please let me know what the right question is.
Note: I have already read the Julia Unit Test docs and Juno Debugging docs. Thanks!
Honestly I quite never use the debugger. I have for my major source files test files, which I include in runtests.jl. There I try to cover every source code line with a test case (following the display in codecov and coveralls).
I work inside MyPkg, activate ., using Revise from my start script, then
after saving my source from I do in the repl include("test/runtests.jl").
In case of a bug, I can directly (with one click) jump from the displayed stack trace to the source code, which is enough in 99.9% of the cases to fix it.
For sure there are better workflows and I’m curious to hear about them.