dt_automate/vendor/github.com/Esword618/unioffice/test-coverage.sh
2025-02-26 23:15:11 +08:00

22 lines
521 B
Bash

#!/bin/bash
PKG=github.com/Esword618/unioffice
ALLPKGS=`go list $PKG/... | grep -iv schema`
cd $GOPATH/src/$PKG
echo "Prebuilding"
go build -i $PKG/...
go test -i $PKG/...
echo -e "mode: atomic" > coverage.txt
echo "Running tests"
for pkg in $ALLPKGS; do
echo $pkg
go test -coverprofile=coverprofile -covermode=atomic $pkg
if [ -f coverprofile ]; then
tail -n+2 coverprofile >> coverage.txt
rm coverprofile
fi
done
rm coverage.out coverage.txte
bash <(curl -s https://codecov.io/bash)