Created
August 10, 2015 23:29
-
-
Save paddycarver/8449553225a10a57757d to your computer and use it in GitHub Desktop.
Run `go vet` on all the Go packages in a directory, then run all their tests, writing test coverage reports to `coverage/pkg.path.out`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SUBPACKAGES := $(foreach pkg,$(sort $(dir $(shell find . -type f -name '*.go'))),$(patsubst %/,%,${pkg})) | |
# run tests with coverage reports. | |
test: | |
@${GO} vet ./... | |
@mkdir -p coverage | |
@for pkg in ${SUBPACKAGES}; do \ | |
go test $$pkg -v -coverprofile=coverage/$${pkg/\//.}.out; \ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment