aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-08-19 04:46:48 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-08-19 04:46:48 +0800
commitcc87551edc62fb8796c2800c655a0162ef7ab441 (patch)
treea04bd0703cdea45766c1c6e5479c5770025d6b62 /build
parentd0dc1b4a60d533a9fb0d8df83eb570e827fc281f (diff)
downloadgo-tangerine-cc87551edc62fb8796c2800c655a0162ef7ab441.tar
go-tangerine-cc87551edc62fb8796c2800c655a0162ef7ab441.tar.gz
go-tangerine-cc87551edc62fb8796c2800c655a0162ef7ab441.tar.bz2
go-tangerine-cc87551edc62fb8796c2800c655a0162ef7ab441.tar.lz
go-tangerine-cc87551edc62fb8796c2800c655a0162ef7ab441.tar.xz
go-tangerine-cc87551edc62fb8796c2800c655a0162ef7ab441.tar.zst
go-tangerine-cc87551edc62fb8796c2800c655a0162ef7ab441.zip
Codecov integration
Diffstat (limited to 'build')
-rwxr-xr-xbuild/test-global-coverage.sh33
1 files changed, 11 insertions, 22 deletions
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