Skip to content

Commit

Permalink
Add coveralls.io support (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
ozerovandrei committed Apr 6, 2018
1 parent 7cf6954 commit ba865a2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ language: go
install:
- go get golang.org/x/tools/cmd/goimports
- go get github.com/golang/lint/golint
- go get github.com/mattn/goveralls
- go get github.com/wadey/gocovmerge
go:
- "1.10"
before_script:
Expand All @@ -11,4 +13,6 @@ before_script:
- ./scripts/imports
- ./scripts/format
script:
- go test -v ./...
- ./scripts/test
after_success:
- $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci
11 changes: 11 additions & 0 deletions scripts/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Run tests and create a coverage profile.
i=0
for testingpkg in $(go list ./selvpcclient/.../testing); do
coverpkg=${testingpkg::-8}
go test -v -covermode count -coverprofile "./${i}.coverprofile" -coverpkg $coverpkg $testingpkg
((i++))
done
gocovmerge "$(ls ./*.coverprofile)" > coverage.out
rm *.coverprofile

0 comments on commit ba865a2

Please sign in to comment.