mirror of
https://github.com/foomo/contentful.git
synced 2025-10-16 12:25:37 +00:00
21 lines
503 B
Bash
Executable File
21 lines
503 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
rm coverage.txt || true
|
|
touch coverage.txt
|
|
|
|
for d in $(go list ./... | grep -v /vendor/); do
|
|
go test -v -coverprofile=profile.out -covermode=count $d
|
|
|
|
if [ -f profile.out ]; then
|
|
cat profile.out >> coverage.txt
|
|
rm profile.out
|
|
fi
|
|
done
|
|
|
|
# to make `go tool cover -html=coverage.txt` happy
|
|
# remove the lines starting with mode
|
|
# remove the empty lines
|
|
sed -i'' -e '/^\s*$/d' coverage.txt
|
|
echo "$(awk '!/^mode:/ || !f++' coverage.txt)" > coverage.txt
|