test: add memory check, reporting and fix some memleaks in tests
All checks were successful
continuous-integration/drone/push Build is passing

Reviewed-on: #14
PR #14
This commit is contained in:
Rick Barenthin 2022-07-30 23:10:31 +02:00
parent 150cca40af
commit d13bad4660
2 changed files with 8 additions and 0 deletions

View File

@ -64,6 +64,12 @@ steps:
- cd cmake-build-ci - cd cmake-build-ci
- cmake --build . - cmake --build .
- make coverage - make coverage
- name: Generate memory report
image: registry.riba-interactive.de/reportly:latest
settings:
input_path: cmake-build-ci
output_path: .reports
debug: true
- name: Report test and coverage - name: Report test and coverage
image: alpine image: alpine

View File

@ -33,6 +33,8 @@ if ((CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR MODERN_CMAKE_BUILD_TESTING)
if (ENABLE_TEST_COVERAGE) if (ENABLE_TEST_COVERAGE)
include(CodeCoverage) include(CodeCoverage)
set(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full")
setup_target_for_coverage_lcov( setup_target_for_coverage_lcov(
NAME coverage NAME coverage
EXECUTABLE ${CMAKE_CTEST_COMMAND} -T memcheck EXECUTABLE ${CMAKE_CTEST_COMMAND} -T memcheck