2014-10-31 18:45:51 +00:00
|
|
|
DIRS := \
|
|
|
|
. \
|
|
|
|
nl
|
|
|
|
|
2014-10-31 19:27:21 +00:00
|
|
|
DEPS = \
|
|
|
|
github.com/vishvananda/netns
|
|
|
|
|
2014-10-31 18:45:51 +00:00
|
|
|
uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
|
|
|
|
testdirs = $(call uniq,$(foreach d,$(1),$(dir $(wildcard $(d)/*_test.go))))
|
2014-10-31 19:27:21 +00:00
|
|
|
goroot = $(addprefix ../../../,$(1))
|
|
|
|
unroot = $(subst ../../../,,$(1))
|
2014-10-31 18:45:51 +00:00
|
|
|
|
|
|
|
all: test
|
|
|
|
|
2014-10-31 19:27:21 +00:00
|
|
|
$(call goroot,$(DEPS)):
|
|
|
|
go get $(call unroot,$@)
|
|
|
|
|
2014-10-31 18:45:51 +00:00
|
|
|
.PHONY: $(call testdirs,$(DIRS))
|
|
|
|
$(call testdirs,$(DIRS)):
|
2014-10-31 19:21:50 +00:00
|
|
|
! gofmt -l $@*.go | grep ''
|
|
|
|
go test -v github.com/vishvananda/netlink/$@
|
2014-10-31 18:45:51 +00:00
|
|
|
|
2014-10-31 19:27:21 +00:00
|
|
|
test: $(call goroot,$(DEPS)) $(call testdirs,$(DIRS))
|