Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lower coverage in Julia v1.11 #346

Open
schillic opened this issue Dec 15, 2024 · 0 comments
Open

Lower coverage in Julia v1.11 #346

schillic opened this issue Dec 15, 2024 · 0 comments

Comments

@schillic
Copy link

In Julia v1.10.6, the code below gets 100% coverage. In Julia v1.11.1, foo is not marked as covered.

src/Example.jl:

module Example

export foo, bar

function foo(x) end       # covered in v1.10 but not covered in v1.11
function bar(x; o=1) end  # covered in both versions

end

test/runtests.jl:

using Example, Test

@test isnothing(foo(1))
@test isnothing(bar(1))

I understand that this package uses a workaround to mark lines as code that then may not be marked as covered. Indeed, with DISABLE_AMEND_COVERAGE_FROM_SRC=yes, I get full coverage in v1.11.

Based on that, I presume the explanation here is that the compiler optimizes foo out, while bar has a default parameter and somehow gets tracked anyway.

But I am surprised to see this change when switching between Julia versions. My questions are:

  • Is this intended behavior?
  • Is there a way to get full coverage back in v1.11 without setting the environment variable?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant