1
0
mirror of https://github.com/rancher/os.git synced 2025-06-20 20:21:54 +00:00
os/scripts/test

15 lines
355 B
Plaintext
Raw Normal View History

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