-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/tools/cmd/cover or cmd/yacc: go tool cover -html shows all lines in yacc generated code as "not tracked" #7483
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Comments
Don't conclude so fast! 0% will show a page with all RED lines! I met this issue when I'm writing a parser with nonzero coverage tests. To show this issue clearly, I spent additional time to modify the expr example to reproduce the issue. How can you come up with a "reason" without actually trying it? It is fine if you don't have much time on this issue, but just don't post such a misleading message irresponsibly, please! |
I was, of course, not discussing any other setup above what you provided as an repro case and the accompanying info. No tests are run by the repro so I expect that not even the information about which lines were omitted by the tests (RED) is thus available. What is the size of profile.cov? #WAI |
> so I expect ... You expect A but it actually does B, what's the point of your expectation? > What is the size of profile.cov? Try for yourself or just leave it. I have attached an updated test case. Attachments:
|
"You expect A but it actually does B". What is B? People can nowadays respond from a phone. Some phones can download a zip file and view its content. Not many phones can run go test, though. The question about the file size is a tech question. The answer to the question is, unfortunately, not technical at all. This should be a technical discussion, please do not repeatedly attempt to divert it to anything else. Thank you. |
Thanks for your efforts spending on this issue even without a Go environment. The issue is not urgent and it already has a workaround (add an extra space to the comment), so I'm not waiting for it to be fixed. (If it is urgent I would rather fix it myself and submit a patch). I posted the issue because I think it might be interesting to understand what exact "go cover" does with the comments with special format "//line xxx", if one of the authors of "go cover" happens to see and answer it. I'm sorry for my impatience. The issue is simple and obvious if you actually run it. More words just don't help. |
I just came across this issue with 1.4rc1 I've just been trying to run coverage on a parser generated with go tool yacc. //go:generate go tool yacc -v y.output grammar.y The "go tool cover -html" flag shows the generated "y.go" file as expected, but it doesn't have any coverage information in it. I guess this is because of the "//line grammar.y:123" directives which have redirected the coverage info "grammar.y". However grammar.y isn't visible in the html view. go tool cover -func z.cover shows stuff for y.go not grammar.y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
by hwang.dev:
Attachments:
The text was updated successfully, but these errors were encountered: