From 7f54ba8f6b66249c5cc431eb6488e7c58634641f Mon Sep 17 00:00:00 2001 From: V2Ray Date: Mon, 7 Sep 2015 21:22:43 +0200 Subject: [PATCH] coverall script --- .travis.yml | 5 +---- testing/coverage/coverall | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 testing/coverage/coverall diff --git a/.travis.yml b/.travis.yml index 029891f5..8bc2792f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,13 +7,10 @@ go: before_install: - go get github.com/axw/gocov/gocov - go get golang.org/x/tools/cmd/cover - - go get github.com/modocache/gover - go get github.com/mattn/goveralls script: - - for d in $(find -type d -printf './%P\n'); do echo go test -v -coverprofile=cover.coverprofile $d; done - - gover - - $HOME/gopath/bin/goveralls -coverprofile=gover.coverprofile -service=travis-ci -repotoken $COVERALLS_TOKEN + - ./testing/coverage/coverall env: secure: "nnEiGTuS8SsSFRpxUsPh6hmx/OfPDA6AO3OX7IpjPCbkQnjuFEsm3DfPEZOHTiYra00Ea3bNw9ePLPqyWdLAPmcLoUBhWRyfevt9m3jrbyrT8O9MCXNDY6i1ll3E43nx8kxRDF1QbYaSK4jppa8Vu2vyZH5+GiS0JVcw/7CfX8TyUMbDuyaQXYQ1kwixlThQZH43xxQ7u5CFF1pBFdwpkuDm2/wKUE+0CGZOeWzUYI8h1in4eY0Vse4Zt4GqS2eywf4rw12bBysZ21UnT/xu990m5nzAScbUGjloplJNpdZGtD8SBTGujZBMMUzKi/E0zJkdEf37MZ9rsarfv6v9khdwTp/8VoAiZxpG1IDISIu0TClAjw8NYO5hmuF01/oJexMuxqRhMPwbk1nPsustlBKEG3zjvW5yILMkiaRl67Pj+9h21zMGYmwPGka7Ollh9ki2h17RFNuj9Yxm5XX2xvZDIvtxL1a8S50vv7VZTT9rrrFMhGP7ty9gj2opjJ7QBgwi2W/eVGhfshfnZJjJ7Bqf+gl1MDOYcTlqmFe5JvKdIO9mN7gskJizmeFxh31LrZ2sCY71/iicGj7gZJ4e/u2/dI2OVfFWTTbHoiIyCLvvrA18zBF9Sky1Y3QDj85GdRtC0SI6TXJLAIa7jNgF6Nr2mAg044DaX9VW0VH0VnE=" \ No newline at end of file diff --git a/testing/coverage/coverall b/testing/coverage/coverall new file mode 100644 index 00000000..a39be2af --- /dev/null +++ b/testing/coverage/coverall @@ -0,0 +1,25 @@ +#!/bin/bash + +echo "mode: set" > coverall.out +fail=0 + +for dir in $(find . -maxdepth 10 -not -path './.git*' -type d); +do + if ls $dir/*.go &> /dev/null; then + go test -coverprofile=coversingle.out $dir || fail=1 + if [ -f coversingle.out ] + then + cat coversingle.out | grep -v "mode: set" >> coverall.out + rm coversingle.out + fi + fi +done + +if [ "$fail" -eq 0 ] +then + $HOME/gopath/bin/goveralls -v -coverprofile=acc.out -service=travis-ci -repotoken $COVERALLS_TOKEN +fi + +rm -f coverall.out + +exit $fail \ No newline at end of file