File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ script:
3131 - export GOOS=${TRAVIS_GOOS}
3232 - make build binaries
3333 - if [ "$GOOS" = "linux" ]; then make vet test; fi
34+ - if [ "$GOOS" = "linux" ]; then sudo PATH=$PATH GOPATH=$GOPATH make root-test; fi
3435 - if [ "$GOOS" != "linux" ]; then make test-compile; fi
3536
3637jobs :
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 -mod=vendor ./version ` .Version=$(VERSION ) "
2222
23+ PKG =github.com/containerd/continuity
24+
2325PACKAGES =$(shell go list -mod=vendor ./... | 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
2637.DEFAULT : default
6475 @echo " + $@ "
6576 @go test -mod=vendor $(PACKAGES )
6677
78+ root-test :
79+ @echo " + $@ "
80+ @go test ${TEST_REQUIRES_ROOT_PACKAGES} -test.root
81+
6782test-compile :
6883 @echo " + $@ "
6984 @for pkg in $(PACKAGES ) ; do go test -mod=vendor -c $$ pkg; done
You can’t perform that action at this time.
0 commit comments