Changeset View
Changeset View
Standalone View
Standalone View
cmake/templates/CoverageTest.sh.in
- This file was added.
Property | Old Value | New Value |
---|---|---|
File Mode | null | 100755 |
#!/bin/sh | |||||
set -e | |||||
# Capture (-c) coverage data generated by the test. | |||||
"${LCOV_EXECUTABLE}" --gcov-tool="${GCOV_EXECUTABLE}" ${LCOV_OPTIONS} \ | |||||
-c -d "${CMAKE_BINARY_DIR}" \ | |||||
-t ${SANITIZED_TARGET} \ | |||||
-o "${TARGET}.info" | |||||
# Reset to zero (-z) the counters (remove the *.gcda coverage files). | |||||
"${LCOV_EXECUTABLE}" --gcov-tool="${GCOV_EXECUTABLE}" ${LCOV_OPTIONS} \ | |||||
-z -d "${CMAKE_BINARY_DIR}" | |||||
# Remove the coverage data for the paths matching any of the patterns. | |||||
"${__COVERAGE_PYTHON}" "${CMAKE_SOURCE_DIR}/cmake/utils/filter-lcov.py" \ | |||||
${LCOV_FILTER_PATTERN} "${TARGET}.info" "${TARGET}_filtered.info" | |||||
# Add (-a) the baseline and test coverage data files to combine them | |||||
# into a single one. | |||||
"${LCOV_EXECUTABLE}" --gcov-tool="${GCOV_EXECUTABLE}" ${LCOV_OPTIONS} \ | |||||
-a "${CMAKE_BINARY_DIR}/baseline.info" \ | |||||
-a "${TARGET}_filtered.info" \ | |||||
-o "${TARGET}_combined.info" | |||||
# Generate the HTML coverage report from the coverage data. | |||||
"${GENHTML_EXECUTABLE}" ${LCOV_OPTIONS} \ | |||||
--demangle-cpp \ | |||||
-s "${TARGET}_combined.info" \ | |||||
-o "${CMAKE_BINARY_DIR}/${TARGET}.coverage" |