feat(cmake): Valgrind memcheck command

This commit is contained in:
Michael Carlberg 2016-12-14 05:07:42 +01:00
parent 5e2a0bd298
commit 060d198b8e
2 changed files with 82 additions and 0 deletions

68
.valgrind-suppressions Normal file
View File

@ -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
...
...
...
...
...
}

View File

@ -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)
# }}}