message: Always cleanup coverage gdca files before executing unit tests
diff: @@ -134,14 +134,24 @@ function(generate_ut UT_EXE_NAME UT_SOURCES_INPUT MOD_DEPS_INPUT)
  add_dependencies(check_leak ${UT_EXE_NAME})
  # Check target for this module
  + # gcda files are generated per object file when executing a binary with coverage enabled
  + # make sure all existing coverage files are removed before running unit test executables
  if (NOT TARGET "${MODULE_NAME}_check")
  - add_custom_target("${MODULE_NAME}_check" COMMAND ${CMAKE_CTEST_COMMAND} --verbose)
  + add_custom_target(
  + "${MODULE_NAME}_check"
  + COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR} find . -name "*.gcda" -delete
  + COMMAND ${CMAKE_CTEST_COMMAND} --verbose
  + )
  endif()
  if (NOT TARGET "${MODULE_NAME}_check_leak")
  - add_custom_target("${MODULE_NAME}_check_leak" COMMAND ${CMAKE_CTEST_COMMAND}
  + add_custom_target(
  + "${MODULE_NAME}_check_leak"
  + COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR} find . -name "*.gcda" -delete
  + COMMAND ${CMAKE_CTEST_COMMAND}
  --overwrite MemoryCheckCommand=/usr/bin/valgrind
  --overwrite MemoryCheckCommandOptions=${MEM_TEST_CLI_OPTIONS}
  - --verbose -T MemCheck)
  + --verbose -T MemCheck
  + )
  endif()
  # Add top ut wrapper for this module
  