aboutsummaryrefslogtreecommitdiff
path: root/run_tests.sh
diff options
context:
space:
mode:
authorKevin Lyda <kevin@ie.suberic.net>2017-01-27 08:48:29 +0000
committerNiall Sheridan <nsheridan@gmail.com>2017-01-27 08:48:29 +0000
commit13054312850d1014e814d2f64afa030a4fea5ef3 (patch)
treec7b7ff70ef7b45aab9f95421f656e2e218465176 /run_tests.sh
parentfe53f90bf0c7fab6cbf5cb019a337e02c6b3ffbf (diff)
Move tests out of travis config to a standalone script
Can also be used as a pre-commit hook.
Diffstat (limited to 'run_tests.sh')
-rwxr-xr-xrun_tests.sh16
1 files changed, 16 insertions, 0 deletions
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