Files
mongo/evergreen/functions/code_coverage_data_process.sh
Steve McClure 4abafc3457 SERVER-92875: Adjust coveralls root to report tree outside of debug/build (#25371)
GitOrigin-RevId: fac1b74d970dbfc342daac32656eeaa0e639536a
2024-07-26 05:23:32 +00:00

42 lines
958 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 and upload data.
# View at https://coveralls.io/github/10gen/mongo
cpp-coveralls \
--root . \
--build-root . \
--verbose \
--gcov ${GCOV_TOOL[@]} \
--exclude src/third_party/ \
--exclude ./grammar.yy \
--exclude ./parser_gen.hpp \
--exclude ./parser_gen.cpp