2020-01-08 13:22:55 -05:00
|
|
|
GO ?= go
|
|
|
|
pkgs = $(shell $(GO) list ./... | grep -v 'github.com/vmware/govmomi/vim25/xml')
|
2017-07-09 14:56:39 -04:00
|
|
|
|
|
|
|
all: check test
|
|
|
|
|
|
|
|
check: goimports govet
|
|
|
|
|
|
|
|
goimports:
|
|
|
|
@echo checking go imports...
|
2020-01-08 13:22:55 -05:00
|
|
|
@command -v goimports >/dev/null 2>&1 || $(GO) get golang.org/x/tools/cmd/goimports
|
2017-07-09 14:56:39 -04:00
|
|
|
@! goimports -d . 2>&1 | egrep -v '^$$'
|
|
|
|
|
|
|
|
govet:
|
|
|
|
@echo checking go vet...
|
2020-01-08 13:22:55 -05:00
|
|
|
@$(GO) vet -structtag=false -methods=false $(pkgs)
|
2017-07-09 14:56:39 -04:00
|
|
|
|
|
|
|
install:
|
2020-01-08 13:22:55 -05:00
|
|
|
$(MAKE) -C govc install
|
|
|
|
$(MAKE) -C vcsim install
|
|
|
|
|
|
|
|
go-test:
|
|
|
|
GORACE=history_size=5 $(GO) test -timeout 5m -count 1 -race -v $(TEST_OPTS) ./...
|
|
|
|
|
|
|
|
govc-test: install
|
|
|
|
./govc/test/images/update.sh
|
|
|
|
(cd govc/test && ./vendor/github.com/sstephenson/bats/libexec/bats -t .)
|
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
test: go-test govc-test
|
2017-07-09 14:56:39 -04:00
|
|
|
|
|
|
|
doc: install
|
|
|
|
./govc/usage.sh > ./govc/USAGE.md
|