We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version
go version go1.11 linux/amd64
Yes
go env
GOARCH="amd64" GOOS="linux"
Created a new project with two sub-packages:
. ├── notests │ └── notests.go └── tests ├── tests.go └── tests_test.go 2 directories, 3 files
notests/notests.go
package notests import "fmt" func untested() { fmt.Print("untested") }
tests/tests.go
package tests import "fmt" func tested() { fmt.Print("tested") }
tests/tests_test.go
package tests import "testing" func TestTested(t *testing.T) { tested() }
Ran go test ./... -v -cover -coverprofile cover.out
go test ./... -v -cover -coverprofile cover.out
$ cat cover.out mode: set empty-cover-profile/notests/notests.go:7.17,9.2 1 0 empty-cover-profile/tests/tests.go:7.15,9.2 1 1
Coverage details for both files.
#18909 requested this functionality, but it wasn't implemented in https://golang.org/cl/76875.
$ cat cover.out mode: set empty-cover-profile/tests/tests.go:7.15,9.2 1 1
Coverage details only for the file with a test in the same directory.
echo "package notests" > notests/notests_test.go
Creating an empty test file creates coverage for both files.
The text was updated successfully, but these errors were encountered:
Dupe of #24570
Sorry, something went wrong.
No branches or pull requests
What version of Go are you using (
go version
)?go version go1.11 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
Created a new project with two sub-packages:
notests/notests.go
tests/tests.go
tests/tests_test.go
Ran
go test ./... -v -cover -coverprofile cover.out
What did you expect to see?
Coverage details for both files.
#18909 requested this functionality, but it wasn't implemented in https://golang.org/cl/76875.
What did you see instead?
Coverage details only for the file with a test in the same directory.
Workaround
Creating an empty test file creates coverage for both files.
The text was updated successfully, but these errors were encountered: