Hi! Currently I am tweaking a toplevel function in my package, and after every change I run pkg> test Example
in my terminal, recompiling Example.
Can I use Revise together with testing, to avoid recompiling Example every time I run the tests?
The way I typically do this is I make a testsuite.jl
file that contains
#testsuite.jl
using MyPackage
using SomeOtherPackage
function test_fobulation(; some_param=10)
@testset "Fobulation test" begin
@test is_fobulated(fobulate(1.0; some_param))
end
end
and then my runtests.jl
file is just
#runtests.jl
include("test_suite.jl")
test_fobulation()
Then, if I want to interactively run tests while I tinker with Revise, I just do
julia> includet("test/test_suite.jl")
in my REPL, and
julia> test_fobulation(; some_param=11)
or whatever to re-run tests without having to recompile the whole module
Last updated: Apr 04 2025 at 04:42 UTC