tile38/scripts/test.sh
tidwall 13ceb7da41 Removed global variables from core package
The core package uses global variables that keep from having
more than one Tile38 instance runnning in the same process.

Move the core variables in the server.Options type which are
uniquely stated per Server instance.

The build variables are still present in the core package.
2022-09-24 15:44:32 -07:00

23 lines
485 B
Bash
Executable File

#!/bin/bash
set -e
cd $(dirname "${BASH_SOURCE[0]}")/..
export CGO_ENABLED=0
cd tests
go test -coverpkg=../internal/server -coverprofile=/tmp/coverage.out $GOTEST
# go test \
# -coverpkg=../internal/... -coverprofile=/tmp/coverage.out \
# -v . -v ../... $GOTEST
go tool cover -html=/tmp/coverage.out -o /tmp/coverage.html
echo "details: file:///tmp/coverage.html"
cd ..
if [[ "$GOTEST" == "" ]]; then
go test $(go list ./... | grep -v /vendor/ | grep -v /tests)
fi