Makefile 680 B

123456789101112131415161718192021222324252627282930
  1. .PHONY: test
  2. all: check test
  3. check: goimports govet
  4. goimports:
  5. @echo checking go imports...
  6. @command -v goimports >/dev/null 2>&1 || go get golang.org/x/tools/cmd/goimports
  7. @! goimports -d . 2>&1 | egrep -v '^$$'
  8. govet:
  9. @echo checking go vet...
  10. @go tool vet -structtags=false -methods=false $$(find . -mindepth 1 -maxdepth 1 -type d -not -name vendor)
  11. install:
  12. $(MAKE) -C govc install
  13. $(MAKE) -C vcsim install
  14. go-test:
  15. GORACE=history_size=5 go test -timeout 5m -count 1 -race -v $(TEST_OPTS) ./...
  16. govc-test: install
  17. (cd govc/test && ./vendor/github.com/sstephenson/bats/libexec/bats -t .)
  18. test: go-test govc-test
  19. doc: install
  20. ./govc/usage.sh > ./govc/USAGE.md