From 6900933bbb3abc5193383915b215316111b0b062 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 11 Jul 2018 19:47:34 +0100 Subject: [PATCH 08/18] Allow longer for tests under valgrind Signed-off-by: Simon McVittie --- test/Makefile.am | 1 + test/test-utils-glib.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/test/Makefile.am b/test/Makefile.am index 5153ab6c..2f338913 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -15,6 +15,7 @@ AM_CPPFLAGS = \ $(APPARMOR_CFLAGS) \ $(GLIB_CFLAGS) \ $(GIO_UNIX_CFLAGS) \ + $(VALGRIND_CFLAGS) \ $(NULL) # improve backtraces from test stuff diff --git a/test/test-utils-glib.c b/test/test-utils-glib.c index 0fc9fd4e..3b447fe8 100644 --- a/test/test-utils-glib.c +++ b/test/test-utils-glib.c @@ -48,6 +48,8 @@ #include +#include "dbus/dbus-valgrind-internal.h" + #ifdef G_OS_WIN # define isatty(x) _isatty(x) #endif @@ -583,6 +585,9 @@ set_timeout (guint factor) if (timeout != 0) g_source_remove (timeout); + if (RUNNING_ON_VALGRIND) + factor = factor * 10; + timeout = g_timeout_add_seconds (TIMEOUT * factor, time_out, NULL); #ifdef G_OS_UNIX /* The GLib main loop might not be running (we don't use it in every -- 2.18.0