Files
mongo/evergreen/functions/code_coverage_data_process.sh
Steve McClure 4175d7751d SERVER-91056: Collect code coverage data for Coveralls consumption (#23570)
GitOrigin-RevId: b49f4bb30bca0c6091e3cfc3f50e9911b108327b
2024-06-24 21:45:19 +00:00

39 lines
873 B
Bash
Executable File

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
. "$DIR/../prelude.sh"
set +o errexit
cd src
if [ ! -d "./build/debug" ]; then
echo "No code coverage to process - no 'build/debug' directory found."
exit 0
fi
file_list=$(find ./build/debug -type f -name "*.gcno")
if [ ! -n "$file_list" ]; then
echo "No code coverage to process - no '.gcno' files found."
exit 0
fi
if [ -z "${GCOV_TOOL:-}" ]; then
echo "No coverage tool defined. Set the gcov_tool expansion in evergreen.yml" >&2
exit 0
fi
echo "Found code coverage files:"
find ./build/debug -type f -name "*.gcno"
activate_venv
pipx install "cpp-coveralls==0.4.2" || exit 1
# run coveralls - currently dumps to a json file
cpp-coveralls \
--root ./build/debug \
--build-root . \
--verbose \
--gcov ${GCOV_TOOL[@]} \
--dump coveralls.json \
--exclude src/third_party/