Merge pull request #36 from apcera/add-coveralls

Add a small script to run the tests and report to coveralls in travis.
This commit is contained in:
Derek Collison
2014-07-25 13:11:36 -07:00
3 changed files with 34 additions and 15 deletions

View File

@@ -1,20 +1,23 @@
language: go
go:
- 1.3
- 1.3
branches:
only:
- master
- master
install:
- DST=~/gopath/src/github.com/apcera
- mkdir -p "$DST"
- git clone --depth=1 --quiet https://github.com/apcera/nats.git "$DST"/nats
- go get code.google.com/p/go.tools/cmd/vet
- DST=~/gopath/src/github.com/apcera
- mkdir -p "$DST"
- git clone --depth=1 --quiet https://github.com/apcera/nats.git "$DST"/nats
- go get code.google.com/p/go.tools/cmd/vet
- go get code.google.com/p/go.tools/cmd/cover
- go get github.com/mattn/goveralls
script:
- go build
- go fmt ./...
- go vet ./...
- go test -i -race ./...
- go test -v -race ./...
- go build
- go fmt ./...
- go vet ./...
- go test -i -race ./...
- go test -v -race ./...
- ./travis/coveralls-script.sh
env:
global:
secure: fi/zxSp5eF6Mt8yrgJakBVinDpCDFy3zPZ4Jy7jsyoKWgF7CdSFmh0WBcN932KOLCRaVm7ZqD2RwO9SifIsBcDtZqML4RKg3Q+T+Uqt4LpskVobMYkPKDcA5i3c3ifhJu/wzl7Y/jnysvjxCwQrH/nGAc4+AwyH6x2TjKF7UFoY=

View File

@@ -1,4 +1,4 @@
# Gnatsd [![Build Status](https://secure.travis-ci.org/apcera/gnatsd.svg?branch=master)](http://travis-ci.org/apcera/gnatsd)
# Gnatsd [![Build Status](https://secure.travis-ci.org/apcera/gnatsd.svg?branch=master)](http://travis-ci.org/apcera/gnatsd) [![Coverage Status](https://img.shields.io/coveralls/apcera/gnatsd.svg)](https://coveralls.io/r/apcera/gnatsd)
A High Performance [NATS](https://github.com/derekcollison/nats) Server written in [Go.](http://golang.org)

16
travis/coveralls-script.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash -e
echo "mode: count" > acc.out
for Dir in $(find ./* -maxdepth 10 -type d | grep -v test);
do
if ls $Dir/*.go &> /dev/null;
then
go test -v -covermode=count -coverprofile=profile.out $Dir
if [ -f profile.out ]
then
cat profile.out | grep -v "mode: count" >> acc.out
fi
fi
done
$HOME/gopath/bin/goveralls -coverprofile=acc.out $COVERALLS
rm -rf ./profile.out
rm -rf ./acc.out