Skip to content

Commit d3baee6

Browse files
committed
added scripts to run unit tests and publish code coverage
1 parent cf2c24f commit d3baee6

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: go
2+
3+
dist: trusty
4+
sudo: false
5+
6+
go:
7+
- 1.9.x
8+
- tip
9+
10+
before_install:
11+
- go get -t -v ./...
12+
13+
script:
14+
- ./scripts/test.sh
15+
16+
after_success:
17+
- bash <(curl -s https://codecov.io/bash)

scripts/test.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
echo "" > coverage.txt
5+
6+
for d in $(go list ./... | grep -v vendor); do
7+
go test -race -coverprofile=profile.out -covermode=atomic "$d"
8+
if [ -f profile.out ]; then
9+
cat profile.out >> coverage.txt
10+
rm profile.out
11+
fi
12+
done

0 commit comments

Comments
 (0)