mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
push test coverage info to coveralls.io
This commit is contained in:
parent
7626c5d526
commit
70fc8a3064
@ -7,6 +7,11 @@ go:
|
|||||||
install:
|
install:
|
||||||
- export PATH=$PATH:$HOME/gopath/bin
|
- export PATH=$PATH:$HOME/gopath/bin
|
||||||
- ./build.sh setup
|
- ./build.sh setup
|
||||||
|
- go get code.google.com/p/go.tools/cmd/cover
|
||||||
|
- go get github.com/mattn/goveralls
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./build.sh test
|
- ./build.sh test-cov
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- goveralls -coverprofile=acc.out -service=travis-ci
|
||||||
|
23
build.sh
23
build.sh
@ -31,6 +31,25 @@ assets() {
|
|||||||
godep go run cmd/assets/assets.go gui > auto/gui.files.go
|
godep go run cmd/assets/assets.go gui > auto/gui.files.go
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test-cov() {
|
||||||
|
echo "mode: set" > acc.out
|
||||||
|
fail=0
|
||||||
|
|
||||||
|
for dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/integration' -not -path '*/_*' -type d);
|
||||||
|
do
|
||||||
|
if ls $dir/*.go &> /dev/null; then
|
||||||
|
godep go test -coverprofile=profile.out $dir || fail=1
|
||||||
|
if [ -f profile.out ]
|
||||||
|
then
|
||||||
|
cat profile.out | grep -v "mode: set" >> acc.out
|
||||||
|
rm profile.out
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
exit $fail
|
||||||
|
}
|
||||||
|
|
||||||
test() {
|
test() {
|
||||||
check
|
check
|
||||||
godep go test -cpu=1,2,4 ./...
|
godep go test -cpu=1,2,4 ./...
|
||||||
@ -100,6 +119,10 @@ case "$1" in
|
|||||||
test
|
test
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
test-cov)
|
||||||
|
test-cov
|
||||||
|
;;
|
||||||
|
|
||||||
tar)
|
tar)
|
||||||
rm -f *.tar.gz *.zip
|
rm -f *.tar.gz *.zip
|
||||||
test || exit 1
|
test || exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user