-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Description
The VS Code test framework is going to get coverage support at some point, and I'd love to use that in the test item framework. For that to work, I would need a much more fine-grained control over coverage output in Julia base, though :)
In particular, Julia processes are re-used across multiple test runs in the test item framework, and I would need to get individual coverage results per test-run. So the model of having just one global coverage output per Julia instance doesn't really work.
I could think of various different ways to solve this.
One could be an API that deletes all accumulated coverage data in the current process and starts writing new coverage data into a new file (a bit like Profile.clear()):
restart_coverage_collection(new_output_filename)Or maybe even more elegant would be a scoped coverage collection a la:
collect_coverage(output_filename) do
# Code for which coverage should be collected goes here
endOr maybe it would even be possible to not write coverage data to disk at all but rather collect in-memory?
coverage_data = collect_coverage() do
# Code for which coverage should be collected goes here
endNot sure how big coverage data gets and whether that is a good idea or not.
I think for my purposes any of these would work well, so maybe the first one would be the simplest?