From 13054312850d1014e814d2f64afa030a4fea5ef3 Mon Sep 17 00:00:00 2001 From: Kevin Lyda Date: Fri, 27 Jan 2017 08:48:29 +0000 Subject: Move tests out of travis config to a standalone script Can also be used as a pre-commit hook. --- run_tests.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 run_tests.sh (limited to 'run_tests.sh') diff --git a/run_tests.sh b/run_tests.sh new file mode 100755 index 0000000..87d5cbd --- /dev/null +++ b/run_tests.sh @@ -0,0 +1,16 @@ +#! /bin/sh + +# This can be used as a pre-commit script. Just run +# cp run_tests.sh .git/hooks/pre-commit +# and it will run before each commit. + +set -xue + +go install -v ./cmd/cashier ./cmd/cashierd +go list ./... |grep -v vendor/ |xargs go test +gofmt -d $(find * -type f -name '*.go' -not -path 'vendor/*') +go list ./... |grep -v vendor/ |xargs go vet +if ! type -f golint > /dev/null; then + go get -u github.com/golang/lint/golint +fi +go list ./... |grep -v vendor/ |xargs -L1 golint -set_exit_status -- cgit v1.2.3