add codecov.io

This commit is contained in:
Tomas Kral
2018-01-30 16:16:49 +01:00
parent 8894cae789
commit ae63e1ad11
6 changed files with 37 additions and 2 deletions

15
scripts/generate-coverage.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
# source: https://github.com/codecov/example-go
# go test can't generate code coverage for multiple packages in one command
set -e
echo "" > coverage.txt
for d in $(go list ./... | grep -v vendor); do
go test -race -coverprofile=profile.out -covermode=atomic $d
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
done