Unit testing and mocking framework for C/C++
Use Valgrind to test for memory leaks:1)
valgrind --tool=memcheck --leak-check=full --track-origins=yes --show-reachable=yes --show-error-list=yes --error-limit=no <executable>
or, if this produces too much warnings about uninitialised values:
valgrind --tool=memcheck --leak-check=full --undef-value-errors=no --show-reachable=yes --show-error-list=yes --error-limit=no <executable>
Valgrind can also be used with CTest.2)
ctest -V -C Debug -T memcheck
when putting this line into CMakeLists.txt
:
set(MEMORYCHECK_SUPPRESSIONS_FILE "${CMAKE_SOURCE_DIR}/.valgrind_suppressions" CACHE FILEPATH "" FORCE) include(CTest)
-fsanitize=address