go.test.sh 438 B

123456789101112131415161718192021
  1. #!/usr/bin/env bash
  2. set -e
  3. touch coverage.txt
  4. # quick-test without -race
  5. go test ./...
  6. # test with "debug" tag
  7. go test -tags debug ./...
  8. # test concurrency
  9. go test -race -cpu=1,2,4 -run TestClient_DoConcurrent
  10. for d in $(go list ./... | grep -v vendor); do
  11. go test -race -coverprofile=profile.out -covermode=atomic "$d"
  12. if [[ -f profile.out ]]; then
  13. cat profile.out >> coverage.txt
  14. rm profile.out
  15. fi
  16. done