github.com/coocood/badger@v1.5.1-0.20200528065104-c02ac3616d04/contrib/cover.sh (about)

     1  #!/bin/bash
     2  
     3  SRC="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.."
     4  TMP=$(mktemp /tmp/badger-coverage-XXXXX.txt)
     5  
     6  BUILD=$1
     7  OUT=$2
     8  
     9  set -e
    10  
    11  pushd $SRC &> /dev/null
    12  
    13  # create coverage output
    14  echo 'mode: atomic' > $OUT
    15  for PKG in $(go list ./...|grep -v -E 'vendor'); do
    16    go test -covermode=atomic -coverprofile=$TMP $PKG
    17    tail -n +2 $TMP >> $OUT
    18  done
    19  
    20  # Another round of tests after turning off mmap
    21  go test -v -vlog_mmap=false github.com/coocood/badger
    22  
    23  popd &> /dev/null