coverall 521 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. echo "mode: set" > coverall.out
  3. fail=0
  4. for dir in $(find . -maxdepth 10 -not -path './.git*' -type d);
  5. do
  6. if ls $dir/*.go &> /dev/null; then
  7. go test -coverprofile=coversingle.out $dir || fail=1
  8. if [ -f coversingle.out ]
  9. then
  10. cat coversingle.out | grep -v "mode: set" >> coverall.out
  11. rm coversingle.out
  12. fi
  13. fi
  14. done
  15. if [ "$fail" -eq 0 ]
  16. then
  17. $HOME/gopath/bin/goveralls -v -coverprofile=acc.out -service=travis-ci -repotoken $COVERALLS_TOKEN
  18. fi
  19. rm -f coverall.out
  20. exit $fail