Created
June 12, 2016 22:28
-
-
Save ReanGD/fd375ab93ae3fff381258f4455c68e59 to your computer and use it in GitHub Desktop.
Travis go test
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 | |
# We truncate the whole file because we are going to put new coverage data into | |
# it. Note that using "echo '' > file" would cause new lines which some | |
# coverage uploader do not like. | |
> coverage.txt | |
for d in $(find ./* -maxdepth 10 -type f -name '*test.go' -not -path "./.git/*" -exec dirname {} \; | sort -u); do | |
go test -covermode=atomic -coverprofile=profile.out $d | |
if [ -f profile.out ]; then | |
cat profile.out >> 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