github.com/stffabi/git-lfs@v2.3.5-0.20180214015214-8eeaa8d88902+incompatible/script/test (about) 1 #!/usr/bin/env bash 2 # 3 # Usage: script/test # run all non-vendored tests 4 # script/test <subpkg> # run just a package's tests 5 6 PACKAGES="$@" 7 if [ $# -eq 0 ]; then 8 # The following vendor test-exclusion grep-s typically need to match the same 9 # set in debian/rules variable DH_GOLANG_EXCLUDES, so update those when adding 10 # here. 11 PACKAGES="$(go list ./... \ 12 | grep -v "github.com/kr/pty" \ 13 | grep -v "github.com/kr/text" \ 14 | grep -v "github.com/olekukonko/ts" \ 15 | grep -v "github.com/pkg/errors" \ 16 | grep -v "github.com/stretchr/testify" \ 17 | grep -v "github.com/xeipuuv/gojsonreference" \ 18 | grep -v "github.com/xeipuuv/gojsonschema" \ 19 )" 20 else 21 PACKAGES="$(echo "$PACKAGES" \ 22 | sed -e 's/ / .\//g' \ 23 | sed -e 's/^\([^\.]\)/.\/\1/g')" 24 fi 25 26 script/fmt 27 28 GO15VENDOREXPERIMENT=1 go test $PACKAGES 29 GO15VENDOREXPERIMENT=1 go tool vet $( 30 echo "$PACKAGES" \ 31 | grep -v vendor \ 32 | grep -v git-source \ 33 | sed -e 's/github\.com\/git-lfs\/git-lfs//g' \ 34 | sed -e 's/^\///g' \ 35 | xargs \ 36 )