1
0
mirror of https://github.com/golang/go synced 2024-11-05 18:56:10 -07:00
Commit Graph

5 Commits

Author SHA1 Message Date
haya14busa
5d8e38b955 cover: handle multiple samples from the same location
This change is ported from src/cmd/cover/profile.go[1].

Now that go test supported -coverprofile with multiple packages (#6909),
x/tools/cover/profile should also handle multiple samples from the same
location.

[1]: f39050c8eb

Fixes golang/go#23076

Change-Id: I1b1d664bf56f7e22c6cb2726df44fb577408c6f7
Reviewed-on: https://go-review.googlesource.com/83078
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2017-12-10 23:11:56 +00:00
David Brophy
e740c56c6b cover: fixed broken error message
The error message is attempting to display the line of text, but was
incorrectly using m (which is always nil) instead of line.

Change-Id: Id09f488b3b7b0e8c3c2cb6e8f0a8d635861c77ac
Reviewed-on: https://go-review.googlesource.com/19330
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-03-08 18:20:19 +00:00
Andrew Gerrand
57335a8a8f cover: accept inaccurate block endings
When cover is used with cgo packages, the coverage profile is produced
from the cgo-generated Go source files, so the profile will reference
line and column numbers from that generated source, even though it names
the original file.
This is okay in general because the cgo-generated Go source files are
very similar to the original, with one significant exception:
the original source may refer to C identifiers such as C.foo(), but the
cgo tool generates source that rewrites these mentions to something like
_Cfunc_foo.
This means that column numbers in coverage profiles might be higher than
they should be, so be lenient when interpreting them.

Update golang/go#9479

Change-Id: Ic3abef07471614101ce0c686d35b85e7e5e6a777
Reviewed-on: https://go-review.googlesource.com/2410
Reviewed-by: Rob Pike <r@golang.org>
2015-01-07 02:00:16 +00:00
David Symonds
24257c8cd2 tools: add import comments.
Change-Id: Idda6e64580432cb9a731e4ebf4005ee4ceb4202d
Reviewed-on: https://go-review.googlesource.com/1244
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 22:42:16 +00:00
Andrew Wilkins
df34f98521 go.tools/cover: split parsing code out from cmd/cover
Split the profile parsing code out of cmd/cover into
a reusable package, to support third-party coverage
tools.

R=golang-dev, r, adg
CC=golang-dev
https://golang.org/cl/36050045
2013-12-03 20:55:21 -08:00