Created
November 12, 2017 04:44
-
-
Save poying/e7bde96e3120b924676c09aaf40ce487 to your computer and use it in GitHub Desktop.
Test script for Go project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
echo "mode: atomic" > coverage.txt | |
for d in $(go list ./... | grep -v vendor); do | |
go test -race -timeout=5s -coverprofile=profile.out -coverpkg=./... -covermode=atomic $d | |
if [ -f profile.out ]; then | |
cat profile.out | grep -v '^mode' >> coverage.txt | |
rm profile.out | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment