Closed dave closed 7 years ago
I didn't add this because it's not quite as straightforward as you might think:
1) Unfortunately go test
can't accept /...
to indicate recursive packages when combined with code coverage:
$ go test -coverprofile=coverage.out ./...
cannot use test profile flag with multiple packages
... so the courtney command has to manually scan the filesystem for sub packages and run one go test
command for each package.
2) In order to get coverage logged cross-package, you need to add all the packages you're testing as a comma separated list to the coverpkg
argument.
You can see the go test
commands that we're running when you add the -v
flag.
However, I can see that this might be of use in certain situations, so I'll look into adding it as an option.
I've added a -l
option that allows you to skip the test step and load pre-prepared coverage files. Let me know what you think: https://github.com/dave/courtney/commit/715958ae7a9ecbe0752033c3d2c76935c71a2f0e
the problem is related with https://github.com/golang/go/issues/6909 and I fixed it by creating https://github.com/haya14busa/goverage
@haya14busa: