Hi, i writing bindings for libmediainfo and when i start to write tests i noted, that coverage is 0.0% and coverprofile is empty, i don't see any files in dropdown when doing go tool cover -html=coverage.out.
go version go1.5.2 linux/amd64
Steps to reproduce:
git clone https://github.com/zhulik/go_mediainfo.git
go test -cover
I know, that this is not first issue with cgo and coverage, #6333 is closed over a year ago, but i have the same issue now.
The text was updated successfully, but these errors were encountered:
go test -cover gives 0.0% if and only if the tests are in a separate package (in this case, rand_test). If the package declaration in rand_test.go is changed to package rand, -cover reports a correct value; and that is the reason the test introduced in CL 71230049 by rsc didn't catch the problem (that test has package p for both the cgo file and the _test file).