mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
tests: basetime: fix timeouts when running under valgrind
This test sets a rather short timeout, increase this when we run under valgrind. Also add a short sleep to the fakesrc ! fakesink pipeline to avoid thrashing the CPU, which would often not stop the main loop when it should. Also fix wrong (0.10) return value from pad probe callback.
This commit is contained in:
parent
609d021f96
commit
73278948a3
1 changed files with 17 additions and 3 deletions
|
@ -24,6 +24,10 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_VALGRIND
|
||||
#include <valgrind/valgrind.h>
|
||||
#endif
|
||||
|
||||
#include <gst/check/gstcheck.h>
|
||||
|
||||
#ifndef GST_DISABLE_PARSE
|
||||
|
@ -55,7 +59,7 @@ buffer_probe_cb (GstPad * pad, GstPadProbeInfo * info, gpointer user_data)
|
|||
}
|
||||
old_ts = new_ts;
|
||||
|
||||
return TRUE;
|
||||
return GST_PAD_PROBE_OK;
|
||||
}
|
||||
|
||||
GST_START_TEST (test_basetime_calculation)
|
||||
|
@ -68,7 +72,7 @@ GST_START_TEST (test_basetime_calculation)
|
|||
loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
/* The "main" pipeline */
|
||||
p1 = gst_parse_launch ("fakesrc ! fakesink", NULL);
|
||||
p1 = gst_parse_launch ("fakesrc ! identity sleep-time=1 ! fakesink", NULL);
|
||||
fail_if (p1 == NULL);
|
||||
|
||||
/* Create a sub-bin that is activated only in "certain situations" */
|
||||
|
@ -130,9 +134,19 @@ baseaudiosrc_suite (void)
|
|||
{
|
||||
Suite *s = suite_create ("baseaudiosrc");
|
||||
TCase *tc_chain = tcase_create ("general");
|
||||
guint timeout;
|
||||
|
||||
/* timeout 6 sec */
|
||||
tcase_set_timeout (tc_chain, 6);
|
||||
timeout = 6;
|
||||
|
||||
#ifdef HAVE_VALGRIND
|
||||
{
|
||||
if (RUNNING_ON_VALGRIND)
|
||||
timeout *= 4;
|
||||
}
|
||||
#endif
|
||||
|
||||
tcase_set_timeout (tc_chain, timeout);
|
||||
suite_add_tcase (s, tc_chain);
|
||||
|
||||
#ifndef GST_DISABLE_PARSE
|
||||
|
|
Loading…
Reference in a new issue