Created
July 8, 2015 19:24
-
-
Save rickb777/717239d1699e69b0724f to your computer and use it in GitHub Desktop.
go-gorp test_all.sh is buggy and inflexible #274
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/test_all.sh b/test_all.sh | |
index 20cf15a..0a6dc99 100755 | |
--- a/test_all.sh | |
+++ b/test_all.sh | |
@@ -1,12 +1,10 @@ | |
-#!/bin/bash | |
+#!/bin/bash -e | |
# on macs, you may need to: | |
# export GOBUILDFLAG=-ldflags -linkmode=external | |
coveralls_testflags="-v -covermode=count -coverprofile=coverage.out" | |
-set -e | |
- | |
echo "Testing against mysql" | |
export GORP_TEST_DSN=gorptest/gorptest/gorptest | |
export GORP_TEST_DIALECT=mysql | |
@@ -26,8 +24,15 @@ echo "Testing against sqlite" | |
export GORP_TEST_DSN=/tmp/gorptest.bin | |
export GORP_TEST_DIALECT=sqlite | |
go test $coveralls_testflags $GOBUILDFLAG $@ . | |
- | |
-if [[ `go version` == *"1.4"* ]] | |
-then | |
- $HOME/gopath/bin/goveralls -covermode=count -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN | |
-fi | |
+rm -f /tmp/gorptest.bin | |
+ | |
+case $(go version) in | |
+ *go1.4*) | |
+ if [ "$(type -p goveralls)" != "" ]; then | |
+ goveralls -covermode=count -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN | |
+ elif [ -x $HOME/gopath/bin/goveralls ]; then | |
+ $HOME/gopath/bin/goveralls -covermode=count -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN | |
+ fi | |
+ ;; | |
+ *) ;; | |
+esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment