]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blame - GNUmakefile
Merge branch 'fix_read_test' of github.com:alexandreFre/terraform-provider-statuscake
[github/fretlink/terraform-provider-statuscake.git] / GNUmakefile
CommitLineData
8904b9d0
J
1TEST?=$$(go list ./... |grep -v 'vendor')
2GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
c1b49eba
RS
3WEBSITE_REPO=github.com/hashicorp/terraform-website
4PKG_NAME=statuscake
8904b9d0
J
5
6default: build
7
8build: fmtcheck
9 go install
10
5f34059a 11test: fmtcheck
8904b9d0
J
12 go test -i $(TEST) || exit 1
13 echo $(TEST) | \
14 xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4
15
16testacc: fmtcheck
17 TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
18
8904b9d0
J
19vet:
20 @echo "go vet ."
21 @go vet $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \
22 echo ""; \
23 echo "Vet found suspicious constructs. Please check the reported constructs"; \
24 echo "and fix them if necessary before submitting the code for review."; \
25 exit 1; \
26 fi
27
28fmt:
29 gofmt -w $(GOFMT_FILES)
30
31fmtcheck:
32 @sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
33
34errcheck:
35 @sh -c "'$(CURDIR)/scripts/errcheck.sh'"
36
8904b9d0 37
ef7ddbff 38test-compile:
39 @if [ "$(TEST)" = "./..." ]; then \
40 echo "ERROR: Set TEST to a specific package. For example,"; \
c1b49eba 41 echo " make test-compile TEST=./$(PKG_NAME)"; \
ef7ddbff 42 exit 1; \
43 fi
44 go test -c $(TEST) $(TESTARGS)
45
c1b49eba
RS
46website:
47ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
48 echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
49 git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
50endif
51 @$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
52
53website-test:
54ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
55 echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
56 git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
57endif
58 @$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
59
07971ca3 60.PHONY: build test testacc vet fmt fmtcheck errcheck test-compile website website-test
8904b9d0 61