summaryrefslogtreecommitdiffhomepage
path: root/.travis/tests.sh
diff options
context:
space:
mode:
authorinsomniac <insomniacslk@users.noreply.github.com>2018-05-06 15:18:30 +0200
committerGitHub <noreply@github.com>2018-05-06 15:18:30 +0200
commit94cb7f39d4813bfd059ccd990f239124525ef564 (patch)
tree686a39e7099ae82c2691b06c860b471edae9e643 /.travis/tests.sh
parent5edf6e397b1f3ad5fff322bd59364d2a1a992d6d (diff)
Added code coverage via Codecov (#60)
Diffstat (limited to '.travis/tests.sh')
-rwxr-xr-x.travis/tests.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/.travis/tests.sh b/.travis/tests.sh
new file mode 100755
index 0000000..ce77be6
--- /dev/null
+++ b/.travis/tests.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+# because things are never simple.
+# See https://github.com/codecov/example-go#caveat-multiple-files
+
+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