19 lines
418 B
Bash
Raw Normal View History

2020-02-08 20:44:46 +08:00
#!/bin/bash
set -e
#set -x # debug/verbose execution
# Ensures removal of file
trap 'rm -f profile.out downloader/*.{mp4,download,jpg}' SIGINT EXIT
# go -race needs CGO_ENABLED to proceed
export CGO_ENABLED=1;
for d in $(go list ./... | grep -v vendor); do
go test -v -race -coverprofile=profile.out -covermode=atomic "${d}"
if [ -f profile.out ]; then
cat profile.out > coverage.txt
rm profile.out
fi
done