From d969de6a6f6e85f45303a530a7ed954b628ab253 Mon Sep 17 00:00:00 2001 From: Eyal Posener Date: Sat, 6 May 2017 00:38:16 +0300 Subject: [PATCH] Add go test script and travis file --- .gitignore | 2 ++ .travis.yml | 17 +++++++++++++++++ go.test.sh | 12 ++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100755 go.test.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1363720 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +coverage.txt diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c942ff1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +language: go +sudo: false +go: + - 1.7 + - 1.8 + - tip + +before_install: + - go get -u -t ./... + +script: + - ./go.test.sh + +after_success: + - bash <(curl -s https://codecov.io/bash) + +comment: off diff --git a/go.test.sh b/go.test.sh new file mode 100755 index 0000000..41fdfc8 --- /dev/null +++ b/go.test.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -e +echo "" > coverage.txt + +for d in $(go list ./... | grep -v vendor); do + go test -count 20 -v -race -coverprofile=profile.out -covermode=atomic $d + if [ -f profile.out ]; then + cat profile.out >> coverage.txt + rm profile.out + fi +done