From fef7d1ec503b2dfe8ca47edecad4a0c69f5fe92f Mon Sep 17 00:00:00 2001 From: Mickael Remond Date: Mon, 1 Jan 2018 19:02:30 +0100 Subject: [PATCH] Test for multiple packages --- codeship-steps.yml | 2 +- test.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 test.sh diff --git a/codeship-steps.yml b/codeship-steps.yml index e53e3cb..e9d19be 100644 --- a/codeship-steps.yml +++ b/codeship-steps.yml @@ -2,7 +2,7 @@ steps: - name: test service: build - command: go test -race -coverprofile=coverage.txt -covermode=atomic ./... + command: ./test.sh - name: codecov service: build command: bash -c "curl -s https://codecov.io/bash" diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..80d33f9 --- /dev/null +++ b/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 -race -coverprofile=profile.out -covermode=atomic $d + if [ -f profile.out ]; then + cat profile.out >> coverage.txt + rm profile.out + fi +done \ No newline at end of file