Is there a package that automatically runs tests when files get updated?

I started using Revise.jl recently and it got me thinking:

is there a package that automatically runs tests every time a file gets saved?

This would be similar in nature to:


I think not having to run Pkg.test("blah") inside a REPL would make testing 10x more enjoyable

2 Likes

@tim.holy, not saying you should make it, but do you have any suggestions on how to accomplish this?

// i.e. done w/ minimum reinventing of the wheel

It could be done with a fairly modest extension to Revise. You’d want to insert a bit of logic right before this line to figure out which packages have been modified and then run their tests. Probably the best way to do that is to use the file2modules variable and build up a Set of all modified Modules. Then you could just have

for mod in modules
    try
        Pkg.test(string(mod))
    end
end

or something. Maybe 10-15 lines of code or so?

2 Likes