From aa03e53ca8d55e74e562f5f56d90e4fd2579fb4e Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 29 Apr 2015 01:27:47 +0200 Subject: Use Makefile for Travis tests --- build/test-global-coverage.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 build/test-global-coverage.sh (limited to 'build') diff --git a/build/test-global-coverage.sh b/build/test-global-coverage.sh new file mode 100755 index 000000000..417c829f4 --- /dev/null +++ b/build/test-global-coverage.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# This script runs all package tests and merges the resulting coverage +# profiles. Coverage is accounted per package under test. + +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/vm" ]]; 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 + fi +done -- cgit v1.2.3