Skip to content
Snippets Groups Projects
Commit da6f7ec9 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Fix temporary file directory for lcov

Previously it was set to build coverage files into the sources. These files are
now produced in the build directory.
parent 02f18722
Branches
Tags
1 merge request!37Feature/language
...@@ -287,14 +287,14 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage") ...@@ -287,14 +287,14 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
add_custom_target(coverage add_custom_target(coverage
ALL # in coverage mode we do coverage! ALL # in coverage mode we do coverage!
# Cleanup previously generated profiling data # Cleanup previously generated profiling data
COMMAND ${LCOV} -q --gcov "${GCOV_BIN}" --base-directory "${PUGS_SOURCE_DIR}/src" --directory "${PUGS_BINARY_DIR}" --zerocounters COMMAND ${LCOV} -q --gcov "${GCOV_BIN}" --base-directory "${PUGS_BINARY_DIR}/src" --directory "${PUGS_BINARY_DIR}" --zerocounters
# Initialize profiling data with zero coverage for every instrumented line of the project # Initialize profiling data with zero coverage for every instrumented line of the project
# This way the percentage of total lines covered will always be correct, even when not all source code files were loaded during the test(s) # This way the percentage of total lines covered will always be correct, even when not all source code files were loaded during the test(s)
COMMAND ${LCOV} -q --gcov "${GCOV_BIN}" --base-directory "${PUGS_SOURCE_DIR}/src" --directory "${PUGS_BINARY_DIR}" --capture --initial --output-file coverage_base.info COMMAND ${LCOV} -q --gcov "${GCOV_BIN}" --base-directory "${PUGS_BINARY_DIR}/src" --directory "${PUGS_BINARY_DIR}" --capture --initial --output-file coverage_base.info
# Run tests # Run tests
COMMAND ${CMAKE_CTEST_COMMAND} -j ${PROCESSOR_COUNT} COMMAND ${CMAKE_CTEST_COMMAND} -j ${PROCESSOR_COUNT}
# Collect data from executions # Collect data from executions
COMMAND ${LCOV} --gcov "${GCOV_BIN}" --base-directory "${PUGS_SOURCE_DIR}/src" --directory "${PUGS_BINARY_DIR}" --capture --output-file coverage_ctest.info COMMAND ${LCOV} --gcov "${GCOV_BIN}" --base-directory "${PUGS_BINARY_DIR}/src" --directory "${PUGS_BINARY_DIR}" --capture --output-file coverage_ctest.info
# Combine base and ctest results # Combine base and ctest results
COMMAND ${LCOV} --gcov "${GCOV_BIN}" -q --add-tracefile coverage_base.info --add-tracefile coverage_ctest.info --output-file coverage_full.info COMMAND ${LCOV} --gcov "${GCOV_BIN}" -q --add-tracefile coverage_base.info --add-tracefile coverage_ctest.info --output-file coverage_full.info
# Extract only project data (--no-capture or --remove options may be used to select collected data) # Extract only project data (--no-capture or --remove options may be used to select collected data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment