tests: Add setup mode to run tests using valgrind

In such case we need to ignore the python errors, so including a suppression
file when using --setup=valgrind.
This commit is contained in:
Marco Trevisan (Treviño) 2019-11-26 18:50:18 +01:00
parent 53713c0098
commit c9216cf96c
2 changed files with 71 additions and 0 deletions

View file

@ -54,3 +54,19 @@ if gdb.found()
gdb.path())
])
endif
valgrind = find_program('valgrind', required: false)
if valgrind.found()
glib_share = glib_dep.get_pkgconfig_variable('prefix') / 'share' / glib_dep.name()
glib_suppressions = glib_share + '/valgrind/glib.supp'
python_suppressions = '@0@/@1@'.format(meson.source_root(),
files('valgrind-python.supp')[0])
add_test_setup('valgrind',
timeout_multiplier: 10,
env: [
'G_SLICE=always-malloc',
('LIBFPRINT_TEST_WRAPPER=@0@ --tool=memcheck --leak-check=full ' +
'--suppressions=@1@ --suppressions=@2@').format(
valgrind.path(), glib_suppressions, python_suppressions)
])
endif

View file

@ -0,0 +1,55 @@
{
ignore_py_cond
Memcheck:Cond
...
fun:Py*
}
{
ignore__py_cond
Memcheck:Cond
...
fun:_Py*
}
{
ignore_py_value8
Memcheck:Value8
...
fun:Py*
}
{
ignore__py_value8
Memcheck:Value8
...
fun:_Py*
}
{
ignore_py_addr4
Memcheck:Addr4
...
fun:Py*
}
{
ignore__py_addr4
Memcheck:Addr4
...
fun:_Py*
}
{
ignore_py_leaks
Memcheck:Leak
...
fun:Py*
}
{
ignore__py_leaks
Memcheck:Leak
...
fun:_Py*
}