]>
Commit | Line | Data |
---|---|---|
1 | TEST?=$$(go list ./... |grep -v 'vendor') | |
2 | GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) | |
3 | ||
4 | default: build | |
5 | ||
6 | build: fmtcheck | |
7 | go install | |
8 | ||
9 | test: fmtcheck | |
10 | go test -i $(TEST) || exit 1 | |
11 | echo $(TEST) | \ | |
12 | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4 | |
13 | ||
14 | testacc: fmtcheck | |
15 | TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m | |
16 | ||
17 | vet: | |
18 | @echo "go vet ." | |
19 | @go vet $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \ | |
20 | echo ""; \ | |
21 | echo "Vet found suspicious constructs. Please check the reported constructs"; \ | |
22 | echo "and fix them if necessary before submitting the code for review."; \ | |
23 | exit 1; \ | |
24 | fi | |
25 | ||
26 | fmt: | |
27 | gofmt -w $(GOFMT_FILES) | |
28 | ||
29 | fmtcheck: | |
30 | @sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'" | |
31 | ||
32 | errcheck: | |
33 | @sh -c "'$(CURDIR)/scripts/errcheck.sh'" | |
34 | ||
35 | vendor-status: | |
36 | @govendor status | |
37 | ||
38 | test-compile: | |
39 | @if [ "$(TEST)" = "./..." ]; then \ | |
40 | echo "ERROR: Set TEST to a specific package. For example,"; \ | |
41 | echo " make test-compile TEST=./aws"; \ | |
42 | exit 1; \ | |
43 | fi | |
44 | go test -c $(TEST) $(TESTARGS) | |
45 | ||
46 | .PHONY: build test testacc vet fmt fmtcheck errcheck vendor-status test-compile | |
47 |