aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-08-19 05:26:14 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-08-19 05:26:14 +0800
commit0737cbc5c1988909b4ce30d3933e475dbd718199 (patch)
treeef8a90dd3241c29520de995939fabce201a3bde7
parent227ff4d2d6559777150eb659aa29d7e403e061dc (diff)
parentcc87551edc62fb8796c2800c655a0162ef7ab441 (diff)
downloadgo-tangerine-0737cbc5c1988909b4ce30d3933e475dbd718199.tar
go-tangerine-0737cbc5c1988909b4ce30d3933e475dbd718199.tar.gz
go-tangerine-0737cbc5c1988909b4ce30d3933e475dbd718199.tar.bz2
go-tangerine-0737cbc5c1988909b4ce30d3933e475dbd718199.tar.lz
go-tangerine-0737cbc5c1988909b4ce30d3933e475dbd718199.tar.xz
go-tangerine-0737cbc5c1988909b4ce30d3933e475dbd718199.tar.zst
go-tangerine-0737cbc5c1988909b4ce30d3933e475dbd718199.zip
Merge pull request #1683 from ethereum/travis
Switch from Coveralls to Codecov code coverage service
-rw-r--r--.travis.yml4
-rwxr-xr-xbuild/test-global-coverage.sh33
2 files changed, 13 insertions, 24 deletions
diff --git a/.travis.yml b/.travis.yml
index 2b3ff92f6..13211f736 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,7 @@ install:
# - go get code.google.com/p/go.tools/cmd/goimports
# - go get github.com/golang/lint/golint
# - go get golang.org/x/tools/cmd/vet
- - go get golang.org/x/tools/cmd/cover github.com/mattn/goveralls
+ - go get golang.org/x/tools/cmd/cover
before_script:
# - gofmt -l -w .
# - goimports -l -w .
@@ -15,7 +15,7 @@ before_script:
script:
- make travis-test-with-coverage
after_success:
- - if [ "$COVERALLS_TOKEN" ]; then goveralls -coverprofile=profile.cov -service=travis-ci -repotoken $COVERALLS_TOKEN; fi
+ - bash <(curl -s https://codecov.io/bash)
env:
global:
- secure: "U2U1AmkU4NJBgKR/uUAebQY87cNL0+1JHjnLOmmXwxYYyj5ralWb1aSuSH3qSXiT93qLBmtaUkuv9fberHVqrbAeVlztVdUsKAq7JMQH+M99iFkC9UiRMqHmtjWJ0ok4COD1sRYixxi21wb/JrMe3M1iL4QJVS61iltjHhVdM64="
diff --git a/build/test-global-coverage.sh b/build/test-global-coverage.sh
index 5bb233a31..a51b6a9e5 100755
--- a/build/test-global-coverage.sh
+++ b/build/test-global-coverage.sh
@@ -1,26 +1,15 @@
-#!/bin/bash
-
-# This script runs all package tests and merges the resulting coverage
-# profiles. Coverage is accounted per package under test.
+#!/usr/bin/env bash
set -e
-
-if [ ! -f "build/env.sh" ]; then
- echo "$0 must be run from the root of the repository."
- exit 2
-fi
-
-echo "mode: count" > profile.cov
-
-for pkg in $(go list ./...); do
- # drop the namespace prefix.
- dir=${pkg##github.com/ethereum/go-ethereum/}
-
- if [[ $dir != "tests" ]]; then
- go test -covermode=count -coverprofile=$dir/profile.tmp $pkg
- fi
- if [[ -f $dir/profile.tmp ]]; then
- tail -n +2 $dir/profile.tmp >> profile.cov
- rm $dir/profile.tmp
+echo "" > coverage.txt
+
+for d in $(find ./* -maxdepth 10 -type d -not -path "./build" -not -path "./Godeps/*" ); do
+ if ls $d/*.go &> /dev/null; then
+ go test -coverprofile=profile.out -covermode=atomic $d
+ if [ -f profile.out ]; then
+ cat profile.out >> coverage.txt
+ echo '<<<<<< EOF' >> coverage.txt
+ rm profile.out
+ fi
fi
done