github.com/agiledragon/gomonkey/v2@v2.11.1-0.20240427155748-d56c6823ec17/ut.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  set -e
     4  echo "" > coverage.txt
     5  
     6  for d in $(go list ./test/...  | grep -v test/fake); do
     7      echo "--------Run test package: $d"
     8      GO111MODULE=on go test -gcflags="all=-N -l" -v -coverprofile=profile.out -coverpkg=./... -covermode=atomic $d
     9      echo "--------Finish test package: $d"
    10      if [ -f profile.out ]; then
    11          cat profile.out >> coverage.txt
    12          rm profile.out
    13      fi
    14  done