github.com/cloudfoundry-attic/garden-linux@v0.333.2-candidate/scripts/test (about)

     1  #!/bin/bash
     2  # vim: set ft=sh
     3  
     4  set -e -x
     5  
     6  FIRST_GOPATH=`echo $GOPATH | cut -d':' -f1`
     7  export PATH=$FIRST_GOPATH/bin:$PATH
     8  
     9  go get code.google.com/p/go.tools/cmd/cover
    10  go get github.com/dustin/goveralls
    11  
    12  export PATH=$GOPATH/bin:$PATH
    13  
    14  mkdir -p /tmp/gobin
    15  export GOBIN=/tmp/gobin
    16  export PATH=$GOBIN:$PATH
    17  go install github.com/onsi/ginkgo/ginkgo
    18  
    19  ginkgo -r -p -race -cover -keepGoing -randomizeAllSpecs -slowSpecThreshold=15 "$@"
    20  
    21  # don't leak coveralls token
    22  set +x
    23  
    24  if [ -n "$COVERALLS_TOKEN" ]; then
    25    profiles=$(find . -name '*.coverprofile' | grep -v fake)
    26  
    27    echo mode: set > all.coverprofile
    28    cat $profiles | grep -v mode: >> all.coverprofile
    29  
    30    goveralls -coverprofile=all.coverprofile $COVERALLS_TOKEN || \
    31      echo "Coveralls failed. :("
    32  fi