Add go test script and travis file

This commit is contained in:
Eyal Posener 2017-05-06 00:38:16 +03:00
parent 8421068045
commit d969de6a6f
3 changed files with 31 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.idea
coverage.txt

17
.travis.yml Normal file
View File

@ -0,0 +1,17 @@
language: go
sudo: false
go:
- 1.7
- 1.8
- tip
before_install:
- go get -u -t ./...
script:
- ./go.test.sh
after_success:
- bash <(curl -s https://codecov.io/bash)
comment: off

12
go.test.sh Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -e
echo "" > coverage.txt
for d in $(go list ./... | grep -v vendor); do
go test -count 20 -v -race -coverprofile=profile.out -covermode=atomic $d
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
done