github.com/yandex/pandora@v0.5.32/script/coverage.sh (about)

     1  #!/bin/bash
     2  
     3  set -o errexit
     4  set -o pipefail
     5  
     6  main() {
     7    _cd_into_top_level
     8    _generate_coverage_files
     9    _combine_coverage_reports
    10  }
    11  
    12  _cd_into_top_level() {
    13    cd "$(git rev-parse --show-toplevel)"
    14  }
    15  
    16  _generate_coverage_files() {
    17    for dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/vendor/*' -not -path '*/mocks/*' -type d); do
    18      if ls $dir/*.go &>/dev/null ; then
    19        go test -covermode=count -coverprofile=$dir/profile.coverprofile $dir || fail=1
    20      fi
    21    done
    22  }
    23  
    24  
    25  _combine_coverage_reports() {
    26    gover
    27  }
    28  
    29  main "$@"