From ce0d68a8bab704e5098c8c381c9e69ffb8ef4da4 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Mon, 22 Feb 2016 00:59:36 -0500 Subject: [PATCH] Make sure to error on test This works around set -e not working in this scenario. --- test.sh | 3 +-- test/test-govet.sh | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100755 test/test-govet.sh diff --git a/test.sh b/test.sh index 453db26b..0bc162ca 100755 --- a/test.sh +++ b/test.sh @@ -16,8 +16,7 @@ diff <(tail -n +$start AUTHORS | sort) <(tail -n +$start AUTHORS) ./test/test-bashfmt.sh ./test/test-headerfmt.sh go test -echo running go vet # since it doesn't output an ok message on pass -go vet && echo PASS +./test/test-govet.sh # do these longer tests only when running on ci if env | grep -q -e '^TRAVIS=true$' -e '^JENKINS_URL=' -e '^BUILD_TAG=jenkins'; then diff --git a/test/test-govet.sh b/test/test-govet.sh new file mode 100755 index 00000000..638a6b26 --- /dev/null +++ b/test/test-govet.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# check that go vet passes +echo running test-govet.sh +ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" # dir! +cd "${ROOT}" + +go vet && echo PASS || exit 1 # since it doesn't output an ok message on pass