gitlab.com/ignitionrobotics/web/ign-go@v1.0.0-rc4/coverage.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  set -e
     4  
     5  # http://stackoverflow.com/a/21142256/2055281
     6  
     7  echo "mode: atomic" > coverage.tx
     8  
     9  for d in $(go list ./...); do
    10      go test  -coverprofile=profile.out -covermode=atomic $d
    11      if [ -f profile.out ]; then
    12          echo "$(pwd)"
    13          cat profile.out | grep -v "mode: " >> coverage.tx
    14          rm profile.out
    15      fi
    16  done