File: cov.sh

package info (click to toggle)
golang-github-nats-io-jwt 0.0~git20181120.285cf2c-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 228 kB
  • sloc: makefile: 16; sh: 11
file content (16 lines) | stat: -rwxr-xr-x 505 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash -e
# Run from directory above via ./scripts/cov.sh

rm -rf ./cov
mkdir cov
go test -v -race -covermode=atomic -coverprofile=./cov/coverage.out -coverpkg=github.com/nats-io/jwt .
gocovmerge ./cov/*.out > coverage.out
rm -rf ./cov

# If we have an arg, assume travis run and push to coveralls. Otherwise launch browser results
if [[ -n $1 ]]; then
    $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service travis-ci
    rm -rf ./coverage.out
else
    go tool cover -html=coverage.out
fi