I want to track test coverage on a go project using Coveralls, the instructions for the integration reference using https://github.com/mattn/goveralls
cd $GOPA
I ended up using this script:
echo "mode: set" > acc.out
for Dir in $(find ./* -maxdepth 10 -type d );
do
if ls $Dir/*.go &> /dev/null;
then
go test -coverprofile=profile.out $Dir
if [ -f profile.out ]
then
cat profile.out | grep -v "mode: set" >> acc.out
fi
fi
done
goveralls -coverprofile=acc.out $COVERALLS
rm -rf ./profile.out
rm -rf ./acc.out
It basically finds all the directories in the path and prints a coverage profile for them separately. It then concatenates the files into one big profile and ships them off to coveralls.