2020-04-15 22:05:11 +00:00
|
|
|
#
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Copyright 2019 Joyent, Inc.
|
|
|
|
#
|
|
|
|
|
2018-05-10 22:40:16 +00:00
|
|
|
TEST?=$$(go list ./... |grep -Ev 'vendor|examples|testutils')
|
|
|
|
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
|
|
|
|
|
2020-04-15 22:05:11 +00:00
|
|
|
.PHONY: all
|
|
|
|
all:
|
2018-05-10 22:40:16 +00:00
|
|
|
|
2020-04-15 22:05:11 +00:00
|
|
|
.PHONY: tools
|
|
|
|
tools: ## Download and install all dev/code tools
|
2018-05-10 22:40:16 +00:00
|
|
|
@echo "==> Installing dev tools"
|
|
|
|
go get -u github.com/golang/dep/cmd/dep
|
|
|
|
|
2020-04-15 22:05:11 +00:00
|
|
|
.PHONY: build
|
|
|
|
build:
|
2018-05-10 22:40:16 +00:00
|
|
|
@govvv build
|
|
|
|
|
2020-04-15 22:05:11 +00:00
|
|
|
.PHONY: install
|
|
|
|
install:
|
2018-05-10 22:40:16 +00:00
|
|
|
@govvv install
|
|
|
|
|
2020-04-15 22:05:11 +00:00
|
|
|
.PHONY: test
|
|
|
|
test: ## Run unit tests
|
2018-05-10 22:40:16 +00:00
|
|
|
@echo "==> Running unit test with coverage"
|
|
|
|
@./scripts/go-test-with-coverage.sh
|
|
|
|
|
2020-04-15 22:05:11 +00:00
|
|
|
.PHONY: testacc
|
|
|
|
testacc: ## Run acceptance tests
|
2018-05-10 22:40:16 +00:00
|
|
|
@echo "==> Running acceptance tests"
|
|
|
|
TRITON_TEST=1 go test $(TEST) -v $(TESTARGS) -run -timeout 120m
|
|
|
|
|
2020-04-15 22:05:11 +00:00
|
|
|
.PHONY: check
|
|
|
|
check:
|
|
|
|
scripts/gofmt-check.sh
|
2018-05-10 22:40:16 +00:00
|
|
|
|
|
|
|
.PHONY: help
|
2020-04-15 22:05:11 +00:00
|
|
|
help: ## Display this help message
|
2018-05-10 22:40:16 +00:00
|
|
|
@echo "GNU make(1) targets:"
|
|
|
|
@grep -E '^[a-zA-Z_.-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
|