File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,4 +30,5 @@ script:
3030 - ../project/script/validate/vendor
3131 - make build binaries
3232 - if [ "$GOOS" = "linux" ]; then make vet test; fi
33+ - if [ "$GOOS" = "linux" ]; then sudo PATH=$PATH GOPATH=$GOPATH make root-test; fi
3334 - if [ "$GOOS" != "linux" ]; then make test-compile; fi
Original file line number Diff line number Diff line change @@ -20,7 +20,18 @@ VERSION=$(shell git describe --match 'v[0-9]*' --dirty='.m' --always)
2020
2121GO_LDFLAGS =-ldflags "-X ` go list ./version ` .Version=$(VERSION ) "
2222
23+ PKG =github.com/containerd/continuity
24+
2325PACKAGES =$(shell go list ./... | grep -v /vendor/)
26+ TEST_REQUIRES_ROOT_PACKAGES =$(filter \
27+ ${PACKAGES}, \
28+ $(shell \
29+ for f in $$(git grep -l testutil.RequiresRoot | grep -v Makefile ) ; do \
30+ d="$$(dirname $$f ) "; \
31+ [ "$$d" = "." ] && echo "${PKG}" && continue; \
32+ echo "${PKG}/$$d"; \
33+ done | sort -u) \
34+ )
2435
2536.PHONY : clean all fmt vet lint build test binaries setup
2637.DEFAULT : default
6879 @echo " + $@ "
6980 @go test $(PACKAGES )
7081
82+ root-test :
83+ @echo " + $@ "
84+ @go test ${TEST_REQUIRES_ROOT_PACKAGES} -test.root
85+
7186test-compile :
7287 @echo " + $@ "
7388 @for pkg in $(PACKAGES ) ; do go test -c $$ pkg; done
You can’t perform that action at this time.
0 commit comments