[libgda] Unit Test: Add 'valgrind' setup for tests



commit 0b3eed5ae701890901069b7718f1991dc5b81d8c
Author: Daniel Espinosa <esodan gmail com>
Date:   Fri Apr 19 19:17:39 2019 -0500

    Unit Test: Add 'valgrind' setup for tests

 tests/gtk.suppression | 294 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/meson.build     |  13 +++
 2 files changed, 307 insertions(+)
---
diff --git a/tests/gtk.suppression b/tests/gtk.suppression
new file mode 100644
index 000000000..2cea334d1
--- /dev/null
+++ b/tests/gtk.suppression
@@ -0,0 +1,294 @@
+#
+# Valgrind suppression file for Gtk+ 2.12
+#
+# Format specification:
+# http://valgrind.org/docs/manual/manual-core.html#manual-core.suppress
+#
+
+#
+# glibc Ubuntu Edgy
+#
+
+{
+   libc: getpwnam_r
+   Memcheck:Addr4
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/tls/i686/cmov/libc-*.so
+   obj:/lib/ld-*.so
+   fun:__libc_dlopen_mode
+   fun:__nss_lookup_function
+   obj:/lib/tls/i686/cmov/libc-*.so
+   fun:__nss_passwd_lookup
+   fun:getpwnam_r
+   fun:g_get_any_init_do
+   fun:g_get_home_dir
+   fun:gtk_rc_add_initial_default_files
+   fun:_gtk_rc_init
+   fun:post_parse_hook
+   fun:g_option_context_parse
+   fun:gtk_parse_args
+   fun:gtk_init_check
+   fun:gtk_init
+}
+
+{
+   libc: getpwnam_r
+   Memcheck:Addr4
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/tls/i686/cmov/libc-*.so
+   obj:/lib/ld-*.so
+   fun:__libc_dlopen_mode
+   fun:__nss_lookup_function
+   obj:/lib/tls/i686/cmov/libc-*.so
+   fun:__nss_passwd_lookup
+   fun:getpwnam_r
+   fun:g_get_any_init_do
+   fun:g_get_home_dir
+   fun:gtk_rc_add_initial_default_files
+   fun:_gtk_rc_init
+   fun:post_parse_hook
+   fun:g_option_context_parse
+   fun:gtk_parse_args
+   fun:gtk_init_check
+   fun:gtk_init
+}
+
+{
+   libc: getpwnam_r
+   Memcheck:Addr4
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/tls/i686/cmov/libc-*.so
+   obj:/lib/ld-*.so
+   fun:__libc_dlopen_mode
+   fun:__nss_lookup_function
+   fun:__nss_next
+   fun:getpwnam_r
+   fun:g_get_any_init_do
+   fun:g_get_home_dir
+   fun:gtk_rc_add_initial_default_files
+   fun:_gtk_rc_init
+   fun:post_parse_hook
+   fun:g_option_context_parse
+   fun:gtk_parse_args
+   fun:gtk_init_check
+   fun:gtk_init
+}
+
+{
+   libc: getpwnam_r
+   Memcheck:Addr4
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/tls/i686/cmov/libc-*.so
+   obj:/lib/ld-*.so
+   fun:__libc_dlopen_mode
+   fun:__nss_lookup_function
+   fun:__nss_next
+   fun:getpwnam_r
+   fun:g_get_any_init_do
+   fun:g_get_home_dir
+   fun:gtk_rc_add_initial_default_files
+   fun:_gtk_rc_init
+   fun:post_parse_hook
+   fun:g_option_context_parse
+   fun:gtk_parse_args
+   fun:gtk_init_check
+   fun:gtk_init
+}
+
+#
+# glibc Ubuntu feisty
+#
+
+{
+   getpwnam_r
+   Memcheck:Leak
+   fun:malloc
+   obj:/lib/libc-2.5.so
+   fun:__nss_database_lookup
+   obj:*
+   obj:*
+   fun:getpwnam_r
+}
+
+#
+# X
+#
+
+{
+   XSupportsLocale
+   Memcheck:Addr4
+   obj:/lib/ld-*.so
+   obj:/lib/tls/i686/cmov/libdl-*.so
+   obj:/lib/ld-*.so
+   obj:/lib/tls/i686/cmov/libdl-*.so
+   fun:dlopen
+   obj:/usr/lib/libX11.so.6.2.0
+   fun:_XlcDynamicLoad
+   fun:_XOpenLC
+   fun:_XlcCurrentLC
+   fun:XSupportsLocale
+   fun:_gdk_x11_initialize_locale
+   fun:_gdk_windowing_init
+   fun:gdk_pre_parse_libgtk_only
+   fun:pre_parse_hook
+   fun:g_option_context_parse
+   fun:gtk_parse_args
+   fun:gtk_init_check
+   fun:gtk_init
+   fun:main
+}
+
+
+{
+   Xcursor
+   Memcheck:Leak
+   fun:malloc
+   obj:/usr/lib/libXcursor.so.1.0.2
+   obj:/usr/lib/libXcursor.so.1.0.2
+   fun:XcursorXcFileLoadImages
+   fun:XcursorFileLoadImages
+   fun:XcursorLibraryLoadImages
+   fun:XcursorShapeLoadImages
+   fun:XcursorTryShapeCursor
+   fun:XCreateGlyphCursor
+   fun:XCreateFontCursor
+   fun:gdk_cursor_new_for_display
+}
+
+{
+   XcursorGetTheme
+   Memcheck:Leak
+   fun:malloc
+   fun:/usr/lib/libX11.so.6.2.0
+   fun:/usr/lib/libX11.so.6.2.0
+   fun:XrmGetStringDatabase
+   fun:XGetDefault
+   fun:_XcursorGetDisplayInfo
+   fun:XcursorGetTheme
+}
+
+{
+   XOpenDisplay
+   Memcheck:Leak
+   fun:calloc
+   fun:XOpenDisplay
+}
+
+{
+   XOpenDisplay
+   Memcheck:Leak
+   fun:malloc
+   fun:XOpenDisplay
+}
+
+#
+# fontconfig
+#
+
+{
+   fontconfig
+   Memcheck:Leak
+   fun:realloc
+   fun:FcPatternObjectInsertElt
+   fun:FcPatternObjectAddWithBinding
+}
+
+{
+   pango_fc_font_map_load_fontset
+   Memcheck:Leak
+   fun:malloc
+   fun:FcLangSetCreate
+   fun:FcLangSetCopy
+   fun:FcValueSave
+   fun:FcPatternObjectAddWithBinding
+   fun:FcPatternObjectAdd
+   fun:FcFontRenderPrepare
+   fun:pango_fc_font_map_load_fontset
+   fun:pango_font_map_load_fontset
+}
+
+{
+   pango_font_map_load_fontset
+   Memcheck:Leak
+   fun:malloc
+   fun:FcPatternObjectAddWithBinding
+   fun:FcPatternObjectAdd
+   fun:FcFontRenderPrepare
+   fun:pango_fc_font_map_load_fontset
+   fun:pango_font_map_load_fontset
+}
+
+{
+   pango_fc_font_map_load_fontset
+   Memcheck:Leak
+   fun:malloc
+   fun:FcStrStaticName
+   fun:FcPatternObjectAddWithBinding
+   fun:FcPatternObjectAdd
+   fun:FcFontRenderPrepare
+   fun:pango_fc_font_map_load_fontset
+}
+
+{
+   pango_fc_font_map_list_families
+   Memcheck:Leak
+   fun:malloc
+   fun:FcStrStaticName
+   fun:FcPatternObjectAddWithBinding
+   fun:FcPatternAdd
+   fun:FcFontSetList
+   fun:FcFontList
+   fun:pango_fc_font_map_list_families
+}
+
+#
+# freetype
+#
+
+{
+   freetype FT_Init_FreeType
+   Memcheck:Leak
+   fun:malloc
+   obj:/usr/lib/libfreetype.so.6.3.10
+   fun:ft_mem_qalloc
+   fun:ft_mem_alloc
+   fun:FT_New_Library
+   fun:FT_Init_FreeType
+}
+
+#
+# glib
+#
+
+{
+   glib g_rand_new
+   Memcheck:Leak
+   fun:calloc
+   fun:g_malloc0
+   fun:g_rand_new_with_seed_array
+   fun:g_rand_new
+   fun:g_random_int
+}
diff --git a/tests/meson.build b/tests/meson.build
index 57fe3bb3c..bc9c22a0b 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,3 +1,16 @@
+vg = find_program('valgrind', required: false)
+if vg.found ()
+add_test_setup('valgrind',
+  exe_wrapper : [vg,
+       '--tool=memcheck',
+       '--leak-check=full',
+       '--leak-resolution=high',
+       '--num-callers=20',
+       '--suppressions='+join_paths(meson.current_source_dir (), 'gtk.suppression'),
+       '--log-file=vgdump'],
+  timeout_multiplier : 100)
+endif
+
 test_cargs = [
        '-include',
        join_paths(gda_top_build, 'config.h'),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]