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

cmd/cover: spurious 0/1 coverage entry for forward-declared functions #6880

Closed
axw opened this issue Dec 3, 2013 · 3 comments
Closed

cmd/cover: spurious 0/1 coverage entry for forward-declared functions #6880

axw opened this issue Dec 3, 2013 · 3 comments
Milestone

Comments

@axw
Copy link
Contributor

axw commented Dec 3, 2013

What steps will reproduce the problem?
1. go test -coverprofile=c.out os
2. go tool cover -func=c.out | grep sigpipe

What is the expected output?

os/file_posix.go:   sigpipe         0.0%
...
total:          (statements)        65.6% (393/599)

What do you see instead?

os/file_posix.go:   sigpipe         0.0%
...
total:          (statements)        65.5% (393/600)

Which compiler are you using (5g, 6g, 8g, gccgo)?

6g

Which operating system are you using?

GNU/Linux

Which version are you using?  (run 'go version')

go version go1.2 linux/amd64

Please provide any additional information below.

I came across this while comparing the output of go tool cover and gocov, finding a
discrepancy in totals. I modified funcOutput in go.tools/cmd/cover/func.go to also print
the raw function coverage counts as well as percentages; in this way, I confirmed that
sigpipe had 0/1 lines covered, and was contributing to the total.
@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 1:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 2:

Labels changed: added repo-tools.

@axw axw added new labels Dec 4, 2013
@bradfitz bradfitz removed the new label Dec 18, 2014
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title go.tools/cmd/cover: spurious 0/1 coverage entry for forward-declared functions x/tools/cmd/cover: spurious 0/1 coverage entry for forward-declared functions Apr 14, 2015
@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015
@rsc rsc removed the repo-tools label Apr 14, 2015
@rsc rsc modified the milestones: Unreleased, Go1.10 Nov 10, 2017
@rsc rsc changed the title x/tools/cmd/cover: spurious 0/1 coverage entry for forward-declared functions cmd/cover: spurious 0/1 coverage entry for forward-declared functions Nov 10, 2017
@gopherbot
Copy link

Change https://golang.org/cl/77152 mentions this issue: cmd/cover: do not report coverage for assembly functions

@golang golang locked and limited conversation to collaborators Nov 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants