1
0
mirror of https://github.com/json-iterator/go.git synced 2025-02-10 19:41:53 +02:00

test and cover multiple packages

This commit is contained in:
Tao Wen 2017-07-02 12:58:14 +08:00
parent 2dfdcdd9db
commit f60a6a17c2
3 changed files with 15 additions and 1 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
.idea
/coverage.txt
/profile.out

View File

@ -8,7 +8,7 @@ before_install:
- go get -t -v ./...
script:
- go test -race -coverprofile=coverage.txt -covermode=atomic
- ./test.sh
after_success:
- bash <(curl -s https://codecov.io/bash)

12
test.sh Executable file
View File

@ -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