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

coverage: support output in LCOV tracefile format #30381

Merged
merged 1 commit into from Dec 20, 2018

Conversation

4 participants
@vtjnash
Copy link
Member

commented Dec 13, 2018

Since Base code-coverage has been broken for stdlibs for a long time, this adds support for a format that doesn't share the same problems. This'll also allow us to adopt the newly-added code-caches for coverage, and to add handling of them to Coverage.jl similar to that already present in Revise.jl.

@vtjnash vtjnash added the testsystem label Dec 13, 2018

@vtjnash vtjnash requested a review from staticfloat Dec 13, 2018

Show resolved Hide resolved src/init.c
Show resolved Hide resolved src/init.c Outdated
Show resolved Hide resolved src/jloptions.c
Show resolved Hide resolved src/runtime_ccall.cpp
Show resolved Hide resolved src/init.c
Show resolved Hide resolved src/processor.cpp
Show resolved Hide resolved test/cmdlineargs.jl
Show resolved Hide resolved test/spawn.jl Outdated
Show resolved Hide resolved test/testenv.jl Outdated
@staticfloat

This comment has been minimized.

Copy link
Member

commented Dec 14, 2018

Adding a test and removing the unnecessary comments would make this good to go from my perspective. I'm just kind of assuming that the info it generates is good; I haven't run it locally to check it, which is why I'm particularly interested in a test.

@vtjnash

This comment has been minimized.

Copy link
Member Author

commented Dec 14, 2018

OK, I added a small test so we'll be alerted earlier if coverage output changes. I had tested the results locally with genhtml to see that it looked valid, and more recently now have also checked that my PRs to Coverage.jl and CoverageBase.jl are successful at analyzing a sample file.

@vtjnash vtjnash force-pushed the jn/lcov branch 4 times, most recently from 3e9c893 to d585095 Dec 17, 2018

Show resolved Hide resolved base/util.jl Outdated

@vtjnash vtjnash force-pushed the jn/lcov branch from d585095 to b621f3f Dec 18, 2018

@vtjnash vtjnash removed the needs news label Dec 18, 2018

@vtjnash vtjnash force-pushed the jn/lcov branch from b621f3f to 11ce9f3 Dec 18, 2018

@vtjnash vtjnash added this to the 1.1 milestone Dec 18, 2018

@JeffBezanson

This comment has been minimized.

Copy link
Member

commented Dec 18, 2018

Why is this on the milestone? It adds a new command line option, which is a new feature.

@JeffBezanson

This comment has been minimized.

Copy link
Member

commented Dec 19, 2018

Rebased as #30453 for release-1.1.

@JeffBezanson JeffBezanson removed this from the 1.1 milestone Dec 19, 2018

coverage: support output in LCOV tracefile format
Also ensure that `julia_cmd` is forwarding all desirable options,
and provide a general framework for specifying formatted filenames
for similar such options.

@JeffBezanson JeffBezanson merged commit 735d755 into master Dec 20, 2018

0 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
julia freebsd ci Build started
Details

@JeffBezanson JeffBezanson deleted the jn/lcov branch Dec 20, 2018

@vtjnash vtjnash referenced this pull request Dec 22, 2018

Open

Coverage misses lines #28192

@bramtayl

This comment has been minimized.

Copy link
Contributor

commented Feb 15, 2019

a) Where is the documentation about how to use this?

b) I've been doing some investigating into why code coverage for LightQuery seems low despite the recent improvements. I tried running the command

julia --code-coverage=tracefile-%p.info --code-coverage=user -e 'include("runtests.jl")'

This gives me a 'tracefile-DIGITS.info' file in my test directory. I can view this info in Atom using the lcov-info package (LCOV itself doesn't seem to support windows...), but first I have to make a coverage directory and rename the file to lcov.info. There's definitely something wrong. I'm getting this entry

SF:ia\dev\LightQuery\src\macros.jl
DA:58,12454531
DA:83,3405931
LH:2
LF:2
end_of_record

I just want a green coverage badge halp

BTW Version 1.2.0-DEV.307 (2019-02-11)

@bramtayl

This comment has been minimized.

Copy link
Contributor

commented Feb 15, 2019

Line 58 points to this macro:

macro _(body)
    anonymous(LineNumberNode(@__LINE__, @__FILE__), macroexpand(@__MODULE__, body)) |> esc
end
@bramtayl

This comment has been minimized.

Copy link
Contributor

commented Feb 18, 2019

Aha! the SF:/ia this is fixed if I put Symbol around @__FILE__; apparently LineNumberNode expects one. still, some docs would be nice.

@bramtayl

This comment has been minimized.

Copy link
Contributor

commented Feb 18, 2019

Also, looking at this, I'm noticing @__LINE__ doesn't seem to do what I'd hope it would do: point to the line number where the macro was called, not defined. I suppose there's no way to get that?

@bramtayl

This comment has been minimized.

Copy link
Contributor

commented Feb 18, 2019

Turns out I just need to pass __source__. Nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.