Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # Copyright (C) 2015 The GoHBase Authors. All rights reserved.
  2. # This file is part of GoHBase.
  3. # Use of this source code is governed by the Apache License 2.0
  4. # that can be found in the COPYING file.
  5. GO := go
  6. TEST_TIMEOUT := 30s
  7. INTEGRATION_TIMEOUT := 120s
  8. GOTEST_FLAGS := -v
  9. GOTEST_ARGS :=
  10. check: vet fmtcheck
  11. jenkins: check test integration
  12. COVER_PKGS := `go list ./... | grep -v test`
  13. COVER_MODE := atomic
  14. integration_cover:
  15. $(GO) test -v -covermode=$(COVER_MODE) -race -timeout=$(INTEGRATION_TIMEOUT) -tags=integration -coverprofile=coverage.out $(COVER_PKGS)
  16. coverage: integration_cover
  17. $(GO) tool cover -html=coverage.out
  18. fmtcheck:
  19. errors=`gofmt -l .`; if test -n "$$errors"; then echo Check these files for style errors:; echo "$$errors"; exit 1; fi
  20. find . -name '*.go' ! -path "./pb/*" ! -path "./test/mock/*" ! -path './gen.go' -exec ./check_line_len.awk {} +
  21. vet:
  22. $(GO) vet ./...
  23. test:
  24. $(GO) test $(GOTEST_FLAGS) -race -timeout=$(TEST_TIMEOUT) ./...
  25. integration:
  26. $(GO) test $(GOTEST_FLAGS) -race -timeout=$(INTEGRATION_TIMEOUT) -tags=integration -args $(GOTEST_ARGS)
  27. .PHONY: check coverage integration_cover fmtcheck integration jenkins test vet