mirror of https://github.com/ethereum/go-ethereum
Merge pull request #1683 from ethereum/travis
Switch from Coveralls to Codecov code coverage servicepull/1687/head
commit
0737cbc5c1
@ -1,26 +1,15 @@ |
|||||||
#!/bin/bash |
#!/usr/bin/env bash |
||||||
|
|
||||||
# This script runs all package tests and merges the resulting coverage |
|
||||||
# profiles. Coverage is accounted per package under test. |
|
||||||
|
|
||||||
set -e |
set -e |
||||||
|
echo "" > coverage.txt |
||||||
if [ ! -f "build/env.sh" ]; then |
|
||||||
echo "$0 must be run from the root of the repository." |
for d in $(find ./* -maxdepth 10 -type d -not -path "./build" -not -path "./Godeps/*" ); do |
||||||
exit 2 |
if ls $d/*.go &> /dev/null; then |
||||||
fi |
go test -coverprofile=profile.out -covermode=atomic $d |
||||||
|
if [ -f profile.out ]; then |
||||||
echo "mode: count" > profile.cov |
cat profile.out >> coverage.txt |
||||||
|
echo '<<<<<< EOF' >> coverage.txt |
||||||
for pkg in $(go list ./...); do |
rm profile.out |
||||||
# 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 |
fi |
||||||
if [[ -f $dir/profile.tmp ]]; then |
|
||||||
tail -n +2 $dir/profile.tmp >> profile.cov |
|
||||||
rm $dir/profile.tmp |
|
||||||
fi |
fi |
||||||
done |
done |
||||||
|
Loading…
Reference in new issue