From b53b2da4af2034a894f57aea9fdba88163a2c90e Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Tue, 5 Nov 2024 22:02:54 -0500 Subject: [PATCH] Update coverage setting propagation for tracked path mode (#25) --- test/runtests.jl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 4e5a425..78f1f26 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -5,8 +5,19 @@ using jlpkg, Test, Pkg, Pkg.TOML const root = joinpath(dirname(dirname(pathof(jlpkg)))) # --compile=yes required due to JuliaLang/julia#37059 # --code_coverage=@ replaced with "user" + +function coverage_arg_string() + cc = Base.JLOptions().code_coverage + if cc < 3 + ("none", "user", "all")[cc+1] + elseif cc == 3 + # path-specific coverage + "@$(unsafe_string(Base.JLOptions().tracked_path))" + end +end + const test_cmd = ```$(Base.julia_cmd()) $(jlpkg.default_julia_flags) - --code-coverage=$(cc = Base.JLOptions().code_coverage; cc == 0 ? "user" : cc == 2 ? "all" : "user") + --code-coverage=$(coverage_arg_string()) --compile=yes --color=no $(joinpath(root, "src", "cli.jl"))```