mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-29 18:48:44 +00:00
check: add support for blacklisting checks via GST_CHECKS_IGNORE
This commit is contained in:
parent
a6656b04de
commit
5e7a7aeaf1
1 changed files with 28 additions and 5 deletions
|
@ -697,18 +697,26 @@ gst_check_run_suite (Suite * suite, const gchar * name, const gchar * fname)
|
|||
return nf;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gst_check_run_test_func (const gchar * func_name)
|
||||
static gboolean
|
||||
gst_check_have_checks_list (const gchar * env_var_name)
|
||||
{
|
||||
const gchar *env_val;
|
||||
|
||||
env_val = g_getenv (env_var_name);
|
||||
return (env_val != NULL && *env_val != '\0');
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_check_func_is_in_list (const gchar * env_var, const gchar * func_name)
|
||||
{
|
||||
const gchar *gst_checks;
|
||||
gboolean res = FALSE;
|
||||
gchar **funcs, **f;
|
||||
|
||||
gst_checks = g_getenv ("GST_CHECKS");
|
||||
gst_checks = g_getenv (env_var);
|
||||
|
||||
/* no filter specified => run all checks */
|
||||
if (gst_checks == NULL || *gst_checks == '\0')
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
|
||||
/* only run specified functions */
|
||||
funcs = g_strsplit (gst_checks, ",", -1);
|
||||
|
@ -722,6 +730,21 @@ _gst_check_run_test_func (const gchar * func_name)
|
|||
return res;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gst_check_run_test_func (const gchar * func_name)
|
||||
{
|
||||
/* if we have a whitelist, run it only if it's in the whitelist */
|
||||
if (gst_check_have_checks_list ("GST_CHECKS"))
|
||||
return gst_check_func_is_in_list ("GST_CHECKS", func_name);
|
||||
|
||||
/* if we have a blacklist, run it only if it's not in the blacklist */
|
||||
if (gst_check_have_checks_list ("GST_CHECKS_IGNORE"))
|
||||
return !gst_check_func_is_in_list ("GST_CHECKS_IGNORE", func_name);
|
||||
|
||||
/* no filter specified => run all checks */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_check_setup_events_with_stream_id:
|
||||
* @srcpad: The src #GstPad to push on
|
||||
|
|
Loading…
Reference in a new issue