const Config *config = context;
/* Some tests are fairly slow, so make the test timeout per-test */
- test_timeout_reset ();
+ test_timeout_reset (1);
f->ctx = test_main_context_get ();
f->ge = NULL;
g_error ("OOM");
/* This can be fairly slow, so make the test timeout per-test */
- test_timeout_reset ();
+ test_timeout_reset (1);
f->n_threads = N_THREADS;
f->n_refs = N_REFS;
#endif
static void
-set_timeout (void)
+set_timeout (guint factor)
{
static guint timeout = 0;
if (timeout != 0)
g_source_remove (timeout);
- timeout = g_timeout_add_seconds (TIMEOUT, time_out, NULL);
+ 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
* test). Die with SIGALRM shortly after if necessary. */
- alarm (TIMEOUT + 10);
+ alarm ((TIMEOUT * factor) + 10);
/* Get a log message and a core dump from the SIGALRM. */
{
{
g_test_init (argcp, argvp, NULL);
g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id=");
- set_timeout ();
+ set_timeout (1);
}
static void
}
void
-test_timeout_reset (void)
+test_timeout_reset (guint factor)
{
GTimer *timer = g_timer_new ();
- g_test_message ("Resetting test timeout (reference: %p)", timer);
- set_timeout ();
+ g_test_message ("Resetting test timeout (reference: %p; factor: %u)",
+ timer, factor);
+ set_timeout (factor);
g_test_queue_destroy (report_and_destroy, timer);
}
void test_rmdir_if_exists (const gchar *path);
void test_mkdir (const gchar *path, gint mode);
-void test_timeout_reset (void);
+void test_timeout_reset (guint factor);
#endif