diff --git a/.valgrind-suppressions b/.valgrind-suppressions new file mode 100644 index 00000000..a66b72fe --- /dev/null +++ b/.valgrind-suppressions @@ -0,0 +1,68 @@ +{ + xft/fontconfig + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + fun:FcPatternCreate + fun:FcFontRenderPrepare + fun:FcFontMatch + fun:XftFontMatch + fun:XftFontOpenName + ... + ... + ... + ... + ... + ... +} +{ + xft/fontconfig + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + obj:/usr/lib/libfontconfig.so.1.9.2 + obj:/usr/lib/libfontconfig.so.1.9.2 + fun:FcPatternAddDouble + obj:/usr/lib/libXft.so.2.3.2 + obj:/usr/lib/libXft.so.2.3.2 + obj:/usr/lib/libXft.so.2.3.2 + obj:/usr/lib/libXft.so.2.3.2 + fun:XftDefaultHasRender + fun:XftDefaultSubstitute + fun:XftFontMatch + fun:XftFontOpenName +} +{ + xft/fontconfig + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + fun:XftFontCheckGlyph + fun:XftGlyphRender + fun:XftDrawGlyphs + fun:XftDrawString16 + ... + ... + ... + ... + ... + ... + ... +} +{ + xft/fontconfig + Memcheck:Leak + match-leak-kinds: definite + fun:realloc + obj:/usr/lib/libfontconfig.so.1.9.2 + obj:/usr/lib/libfontconfig.so.1.9.2 + fun:FcFontRenderPrepare + fun:FcFontMatch + fun:XftFontMatch + fun:XftFontOpenName + ... + ... + ... + ... + ... +} diff --git a/cmake/build/targets.cmake b/cmake/build/targets.cmake index ca924a9b..27d2896e 100644 --- a/cmake/build/targets.cmake +++ b/cmake/build/targets.cmake @@ -45,3 +45,17 @@ add_custom_command(TARGET codecheck-fix COMMAND ${PROJECT_SOURCE_DIR}/common/clang-tidy.sh ${PROJECT_BINARY_DIR} -fix ${PROJECT_SOURCE_DIR}/src) # }}} + +# Target: memcheck (valgrind) {{{ + +add_custom_target(memcheck) +add_custom_command(TARGET memcheck COMMAND + valgrind + --tool=memcheck + --leak-check=yes + --track-origins=yes + --show-reachable=yes + --suppressions=${PROJECT_SOURCE_DIR}/.valgrind-suppressions + ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME} example --config=${PROJECT_SOURCE_DIR}/examples/config) + +# }}}