1TEST?=$$(go list ./... | grep -v '/go-datadog-api/vendor/') 2GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor) 3 4default: test fmt 5 6generate: 7 go generate 8 9# test runs the unit tests and vets the code 10test: 11 go test . $(TESTARGS) -v -timeout=30s -parallel=4 12 @$(MAKE) vet 13 14# testacc runs acceptance tests 15testacc: 16 go test integration/* -v $(TESTARGS) -timeout 90m 17 18# testrace runs the race checker 19testrace: 20 go test -race $(TEST) $(TESTARGS) 21 22fmt: 23 gofmt -w $(GOFMT_FILES) 24 25# vet runs the Go source code static analysis tool `vet` to find 26# any common errors. 27vet: 28 @echo "go vet" 29 @go vet; if [ $$? -ne 0 ]; then \ 30 echo ""; \ 31 echo "Vet found suspicious constructs. Please check the reported constructs"; \ 32 echo "and fix them if necessary before submitting the code for review."; \ 33 exit 1; \ 34 fi 35 36.PHONY: default test testacc updatedeps vet 37