2017-06-24 00:11:20 +02:00
|
|
|
#!/usr/bin/env bash
|
2018-09-03 18:49:57 +02:00
|
|
|
set -o errexit
|
|
|
|
|
2017-09-14 03:52:06 +02:00
|
|
|
export PKGS='./pkg/... ./cmd/...'
|
|
|
|
export PKGS_COMMA='./pkg/...,./cmd/...'
|
2018-09-03 18:49:57 +02:00
|
|
|
|
2018-11-05 23:34:48 +01:00
|
|
|
go test -count=1 -i ${PKGS}
|
|
|
|
go list -f '{{if gt (len .TestGoFiles) 0}}"go test -count=1 -covermode count -coverprofile {{.Name}}.coverprofile -coverpkg $PKGS_COMMA {{.ImportPath}}"{{end}}' $PKGS | xargs -P100 -I {} bash -c {} 2>&1 | grep -v '^warning: no packages being tested depend on '
|
2018-09-03 18:49:57 +02:00
|
|
|
gocovmerge $(ls *.coverprofile) > coverage.cov
|
2017-06-24 00:11:20 +02:00
|
|
|
go tool cover -func=coverage.cov
|
|
|
|
rm *.coverprofile
|
|
|
|
|
2018-11-05 23:34:48 +01:00
|
|
|
exit 0
|