2015-02-17 17:01:03 -07:00
|
|
|
#!/bin/bash
|
2016-05-22 23:11:26 -07:00
|
|
|
# help: Run go unit tests
|
2017-07-17 22:46:42 +10:00
|
|
|
set -ex
|
2015-02-17 17:01:03 -07:00
|
|
|
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
|
2016-05-06 10:12:09 -07:00
|
|
|
echo Running tests
|
2015-02-17 17:01:03 -07:00
|
|
|
|
2018-12-02 20:31:02 +08:00
|
|
|
PACKAGES=". $(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')"
|
2015-02-17 17:01:03 -07:00
|
|
|
|
2016-05-31 21:11:03 -07:00
|
|
|
if [ "$ARCH" = "amd64" ]; then
|
|
|
|
RACE="-race"
|
|
|
|
fi
|
2017-03-23 05:40:14 +00:00
|
|
|
go test $RACE -v -cover -tags=test ${PACKAGES}
|