2015-04-11 13:21:56 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2016-02-12 16:50:37 -08:00
|
|
|
export GO15VENDOREXPERIMENT=1
|
|
|
|
|
2015-04-11 13:21:56 -07:00
|
|
|
# Create a temp dir and clean it up on exit
|
2015-04-12 01:36:13 +00:00
|
|
|
TEMPDIR=`mktemp -d -t consul-test.XXX`
|
2015-04-11 13:21:56 -07:00
|
|
|
trap "rm -rf $TEMPDIR" EXIT HUP INT QUIT TERM
|
|
|
|
|
|
|
|
# Build the Consul binary for the API tests
|
|
|
|
echo "--> Building consul"
|
|
|
|
go build -o $TEMPDIR/consul || exit 1
|
|
|
|
|
|
|
|
# Run the tests
|
|
|
|
echo "--> Running tests"
|
2016-02-18 19:42:06 -08:00
|
|
|
go list ./... | grep -v ^github.com/hashicorp/consul/vendor/ | PATH=$TEMPDIR:$PATH xargs -n1 go test ${GOTEST_FLAGS:-}
|