From 43d838f2800f8e512dc664e525e062e9ddeebec6 Mon Sep 17 00:00:00 2001 From: Seth Goings Date: Mon, 1 Feb 2016 16:58:37 -0700 Subject: [PATCH] remove duplicate test target @ root add structure for [lint,vet,test-unit] all wrapped up by the test target --- Makefile | 2 -- expandybird/Makefile | 18 ++++++++++++++++-- include.mk | 2 ++ 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 include.mk diff --git a/Makefile b/Makefile index 5d8ee70d2..f1dedcaec 100644 --- a/Makefile +++ b/Makefile @@ -49,5 +49,3 @@ $(TARGETS) : % : $(addsuffix %,$(SUBDIRS)) $(SUBDIRS_TARGETS) : $(MAKE) -C $(@D) $(@F:.%=%) -test: - go test -v ./... diff --git a/expandybird/Makefile b/expandybird/Makefile index 4e4644625..398f0b20b 100644 --- a/expandybird/Makefile +++ b/expandybird/Makefile @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +include ../include.mk + .PHONY : all build test push container clean DOCKER_REGISTRY := gcr.io @@ -47,5 +49,17 @@ clean: -docker rmi $(PREFIX)/$(IMAGE):$(TAG) rm -f expandybird -test: - go test -v ./... +.PHONY: test +test: lint vet test-unit + +.PHONY: test-unit +test-unit: + $(GO_TEST) + +.PHONY: lint +lint: + $(GO_LINT) + +.PHONY: vet +vet: + $(GO_VET) diff --git a/include.mk b/include.mk new file mode 100644 index 000000000..d7ad224aa --- /dev/null +++ b/include.mk @@ -0,0 +1,2 @@ +GO_VET := echo using go vet +GO_TEST := go test -v ./...