2016-01-29 20:53:56 +01:00
|
|
|
.PHONY: \
|
|
|
|
all \
|
|
|
|
vendor \
|
|
|
|
lint \
|
|
|
|
vet \
|
|
|
|
fmt \
|
|
|
|
fmtcheck \
|
|
|
|
pretest \
|
|
|
|
test \
|
|
|
|
integration \
|
|
|
|
cov \
|
|
|
|
clean
|
|
|
|
|
2016-04-11 00:16:10 +02:00
|
|
|
PKGS = . ./testing
|
2016-01-29 20:53:56 +01:00
|
|
|
|
|
|
|
all: test
|
|
|
|
|
|
|
|
vendor:
|
|
|
|
@ go get -v github.com/mjibson/party
|
|
|
|
party -d external -c -u
|
|
|
|
|
|
|
|
lint:
|
|
|
|
@ go get -v github.com/golang/lint/golint
|
2016-04-11 00:16:10 +02:00
|
|
|
@for file in $$(git ls-files '*.go' | grep -v 'external/'); do \
|
|
|
|
export output="$$(golint $${file} | grep -v 'type name will be used as docker.DockerInfo')"; \
|
|
|
|
[ -n "$${output}" ] && echo "$${output}" && export status=1; \
|
|
|
|
done; \
|
|
|
|
exit $${status:-0}
|
2016-01-29 20:53:56 +01:00
|
|
|
|
|
|
|
vet:
|
|
|
|
$(foreach pkg,$(PKGS),go vet $(pkg);)
|
|
|
|
|
|
|
|
fmt:
|
2016-04-11 00:16:10 +02:00
|
|
|
gofmt -s -w $(PKGS)
|
2016-01-29 20:53:56 +01:00
|
|
|
|
|
|
|
fmtcheck:
|
2016-04-11 00:16:10 +02:00
|
|
|
@ export output=$$(gofmt -s -d $(PKGS)); \
|
|
|
|
[ -n "$${output}" ] && echo "$${output}" && export status=1; \
|
|
|
|
exit $${status:-0}
|
2016-01-29 20:53:56 +01:00
|
|
|
|
|
|
|
pretest: lint vet fmtcheck
|
|
|
|
|
2016-04-11 00:16:10 +02:00
|
|
|
gotest:
|
2016-01-29 20:53:56 +01:00
|
|
|
$(foreach pkg,$(PKGS),go test $(pkg) || exit;)
|
|
|
|
|
2016-04-11 00:16:10 +02:00
|
|
|
test: pretest gotest
|
|
|
|
|
2016-01-29 20:53:56 +01:00
|
|
|
integration:
|
|
|
|
go test -tags docker_integration -run TestIntegration -v
|
|
|
|
|
|
|
|
cov:
|
|
|
|
@ go get -v github.com/axw/gocov/gocov
|
|
|
|
@ go get golang.org/x/tools/cmd/cover
|
|
|
|
gocov test | gocov report
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(foreach pkg,$(PKGS),go clean $(pkg) || exit;)
|