forked from git-lfs/git-lfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest
More file actions
executable file
·37 lines (34 loc) · 1.19 KB
/
test
File metadata and controls
executable file
·37 lines (34 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
#
# Usage: script/test # run all non-vendored tests
# script/test <subpkg> # run just a package's tests
PACKAGES="$@"
if [ $# -eq 0 ]; then
# The following vendor test-exclusion grep-s typically need to match the same
# set in debian/rules variable DH_GOLANG_EXCLUDES, so update those when adding
# here.
PACKAGES="$(go list ./... \
| grep -v "github.com/kr/pty" \
| grep -v "github.com/kr/text" \
| grep -v "github.com/olekukonko/ts" \
| grep -v "github.com/pkg/errors" \
| grep -v "github.com/stretchr/testify" \
| grep -v "github.com/xeipuuv/gojsonreference" \
| grep -v "github.com/xeipuuv/gojsonschema" \
| grep -v "github.com/alexbrainman/sspi" \
)"
else
PACKAGES="$(echo "$PACKAGES" \
| sed -e 's/ / .\//g' \
| sed -e 's/^\([^\.]\)/.\/\1/g')"
fi
script/fmt
GO15VENDOREXPERIMENT=1 go test $PACKAGES
GO15VENDOREXPERIMENT=1 go tool vet $(
echo "$PACKAGES" \
| grep -v vendor \
| grep -v git-source \
| sed -e 's/github\.com\/git-lfs\/git-lfs//g' \
| sed -e 's/^\///g' \
| xargs \
)