github.com/schwarzm/garden-linux@v0.0.0-20150507151835-33bca2147c47/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  WORKSPACE=$PWD/Godeps/_workspace
    13  
    14  export GOPATH=$WORKSPACE:$GOPATH
    15  export PATH=$WORKSPACE/bin:$PATH
    16  
    17  mkdir -p /tmp/gobin
    18  export GOBIN=/tmp/gobin
    19  export PATH=$GOBIN:$PATH
    20  go install github.com/onsi/ginkgo/ginkgo
    21  
    22  ginkgo -r -p -race -cover -keepGoing -randomizeAllSpecs -slowSpecThreshold=15 "$@"
    23  
    24  # don't leak coveralls token
    25  set +x
    26  
    27  if [ -n "$COVERALLS_TOKEN" ]; then
    28    profiles=$(find . -name '*.coverprofile' | grep -v fake)
    29  
    30    echo mode: set > all.coverprofile
    31    cat $profiles | grep -v mode: >> all.coverprofile
    32  
    33    goveralls -coverprofile=all.coverprofile $COVERALLS_TOKEN || \
    34      echo "Coveralls failed. :("
    35  fi