mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 00:27:38 +00:00
8bf9cd853f
Former-commit-id: ff5dba816571945e8c0837f3ef52485da5fd7314 [formerly 2f23f618fd8f01331b593ab4e064138047fe7c77] Former-commit-id: 1ec5e7440481e307be5e131ac0a416fd7d2fea9f
27 lines
652 B
Bash
Executable File
27 lines
652 B
Bash
Executable File
#!/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" ]]; 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
|