diff options
author | Jake <jake@gnu.space> | 2017-06-05 20:54:15 +0000 |
---|---|---|
committer | Jake <jake@gnu.space> | 2017-06-05 20:54:15 +0000 |
commit | 8904b9d035e113e0c052acfed35c4ab5a6d6973b (patch) | |
tree | 942866927d945dcbe16028d682d73758a871acea /GNUmakefile | |
download | terraform-provider-statuscake-8904b9d035e113e0c052acfed35c4ab5a6d6973b.tar.gz terraform-provider-statuscake-8904b9d035e113e0c052acfed35c4ab5a6d6973b.tar.zst terraform-provider-statuscake-8904b9d035e113e0c052acfed35c4ab5a6d6973b.zip |
initial commit
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..151c78c --- /dev/null +++ b/GNUmakefile | |||
@@ -0,0 +1,58 @@ | |||
1 | TEST?=$$(go list ./... |grep -v 'vendor') | ||
2 | GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) | ||
3 | COVER_TEST?=$$(go list ./... |grep -v 'vendor') | ||
4 | |||
5 | default: build | ||
6 | |||
7 | build: fmtcheck | ||
8 | go install | ||
9 | |||
10 | test: fmtcheck errcheck | ||
11 | go test -i $(TEST) || exit 1 | ||
12 | echo $(TEST) | \ | ||
13 | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4 | ||
14 | |||
15 | testacc: fmtcheck | ||
16 | TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m | ||
17 | |||
18 | testrace: fmtcheck | ||
19 | TF_ACC= go test -race $(TEST) $(TESTARGS) | ||
20 | |||
21 | cover: | ||
22 | @go tool cover 2>/dev/null; if [ $$? -eq 3 ]; then \ | ||
23 | go get -u golang.org/x/tools/cmd/cover; \ | ||
24 | fi | ||
25 | go test $(COVER_TEST) -coverprofile=coverage.out | ||
26 | go tool cover -html=coverage.out | ||
27 | rm coverage.out | ||
28 | |||
29 | vet: | ||
30 | @echo "go vet ." | ||
31 | @go vet $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \ | ||
32 | echo ""; \ | ||
33 | echo "Vet found suspicious constructs. Please check the reported constructs"; \ | ||
34 | echo "and fix them if necessary before submitting the code for review."; \ | ||
35 | exit 1; \ | ||
36 | fi | ||
37 | |||
38 | fmt: | ||
39 | gofmt -w $(GOFMT_FILES) | ||
40 | |||
41 | fmtcheck: | ||
42 | @sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'" | ||
43 | |||
44 | errcheck: | ||
45 | @sh -c "'$(CURDIR)/scripts/errcheck.sh'" | ||
46 | |||
47 | vendor-status: | ||
48 | @govendor status | ||
49 | |||
50 | test-compile: fmtcheck | ||
51 | @if [ "$(TEST)" = "./..." ]; then \ | ||
52 | echo "ERROR: Set TEST to a specific package. For example,"; \ | ||
53 | echo " make test-compile TEST=./builtin/providers/aws"; \ | ||
54 | exit 1; \ | ||
55 | fi | ||
56 | go test -c $(TEST) $(TESTARGS) | ||
57 | |||
58 | .PHONY: build test testacc testrace cover vet fmt fmtcheck errcheck vendor-status test-compile | ||