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

Code coverage over reported? Difference between Julia 0.6, 0.7, 1.0 #29785

Closed
fingolfin opened this issue Oct 23, 2018 · 1 comment
Closed

Code coverage over reported? Difference between Julia 0.6, 0.7, 1.0 #29785

fingolfin opened this issue Oct 23, 2018 · 1 comment

Comments

@fingolfin
Copy link
Contributor

While working on getting Coverage.jl up to speed for use with Julia 0.7 and 1.0 (see JuliaCI/Coverage.jl#179) I noticed the following; I am unsure whether this is a bug, a misfeature, or (most likely) just something I don't understand regarding the code coverage reported by Julia.

Consider this simple input file, stored as tc.jl:

f(x) = 2x

module TestModule
end

Now I run Julia like this:

julia --code-coverage -L tc.jl -e "using Compat, Compat.Test; @test f(2) == 4"

Then I get the following results ...

... with Julia 0.6.4:

        1 f(x) = 2x
        - 
        - module TestModule
        - end
        - 

... with Julia 0.7.0.

        2 f(x) = 2x
        - 
        3 module TestModule
        - end
        - 

... with Julia 1.0.1 and master:

        2 f(x) = 2x
        - 
        - module TestModule
        - end
        - 

So the "3" for the module seems to be a bug that's been fixed in Julia 1.x, fine. But what puzzles me is that 2 (instead of 1 for Julia 0.6) for the line f(x) = 2x. Is that a bug? Or a quirk of the code coverage implementation? Or something else?

@ararslan
Copy link
Member

Coverage on Julia 0.7 and higher is kind of messed up, I believe due to changes in Julia's optimizer. See also #28192.

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

2 participants