forked from gramework/gramework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.test.sh
More file actions
executable file
·29 lines (23 loc) · 806 Bytes
/
.test.sh
File metadata and controls
executable file
·29 lines (23 loc) · 806 Bytes
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
#!/usr/bin/env bash
set -e
echo "" > coverage.txt
LIST=$(go list ./... | grep -v vendor)
# grypto has no internal dependencies, but takes very long time to test.
# to speedup build now we need to trottle builds with travis cache.
CACHEDIR=$HOME/.longtestcache
if [ ! -d $CACHEDIR ]; then
mkdir $CACHEDIR
date > $CACHEDIR/grypto
elif [ -f $CACHEDIR/grypto ]; then
del=( "github.com/gramework/gramework/grypto" )
LIST=( "${LIST[@]/$del}")
echo "skipping grypto. latest build was on $(cat $CACHEDIR/grypto)"
fi
echo LIST: ${LIST}
for d in $(go list ./... | grep -v vendor); do
sudo GOPATH=$GOPATH GOROOT=$GOROOT `which go` test -bench=. -benchmem -v -race -coverprofile=profile.out -covermode=atomic $d
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm -rf profile.out
fi
done