blob: a7d8a6d5f553188f6316b25afccc07e917d4bd5c [file] [log] [blame]
Matt Jeanneretcab955f2019-04-10 15:45:57 -04001#!/usr/bin/env bash
2
3TEST=./...;
4FMT="*.go"
5
6echo "Running tests...";
7go test -v -cover -cpu 1,2,4 $TEST;
8go test -v -cover -cpu 1,2,4 -race $TEST;
9
10echo "Checking gofmt..."
11fmtRes=$(gofmt -l -s $FMT)
12if [ -n "${fmtRes}" ]; then
13 echo -e "gofmt checking failed:\n${fmtRes}"
14 exit 255
15fi
16
17echo "Checking govet..."
18vetRes=$(go vet $TEST)
19if [ -n "${vetRes}" ]; then
20 echo -e "govet checking failed:\n${vetRes}"
21 exit 255
22fi
23
24echo "Success";