tests/check/generic/states.c: Copy the states.c test from core again

Original commit message from CVS:
* tests/check/generic/states.c: (GST_START_TEST):
Copy the states.c test from core again
* tests/check/Makefile.am:
ignore cdio and cdparanoiasrc
This commit is contained in:
Thomas Vander Stichele 2007-02-28 12:44:53 +00:00
parent 14cd6e6ae1
commit eb6d2476c6
3 changed files with 31 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2007-02-28 Thomas Vander Stichele <thomas at apestaart dot org>
* tests/check/generic/states.c: (GST_START_TEST):
Copy the states.c test from core again
* tests/check/Makefile.am:
ignore cdio and cdparanoiasrc
2007-02-28 Stefan Kost <ensonic@users.sf.net>
* gst/audioconvert/audioconvert.c: (float), (double), (float_hq),

View file

@ -7,6 +7,7 @@ REGISTRY_ENVIRONMENT = \
TESTS_ENVIRONMENT = \
CK_DEFAULT_TIMEOUT=120 \
STATE_IGNORE_ELEMENTS="$(STATE_IGNORE_ELEMENTS)" \
$(REGISTRY_ENVIRONMENT) \
GST_PLUGIN_SYSTEM_PATH= \
GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext:$(GST_PLUGINS_DIR)
@ -19,6 +20,9 @@ clean-local: clean-local-check
$(CHECK_REGISTRY):
$(TESTS_ENVIRONMENT)
# elements to ignore for the state tests
STATE_IGNORE_ELEMENTS = cdio cdparanoiasrc
TESTS = $(check_PROGRAMS)
if USE_ALSA

View file

@ -33,8 +33,15 @@ GST_START_TEST (test_state_changes)
GstElement *element;
GList *features, *f;
GList *plugins, *p;
gchar **ignorelist = NULL;
const gchar *STATE_IGNORE_ELEMENTS = NULL;
GST_DEBUG ("testing elements from source %s", PACKAGE);
STATE_IGNORE_ELEMENTS = g_getenv ("STATE_IGNORE_ELEMENTS");
if (STATE_IGNORE_ELEMENTS) {
GST_DEBUG ("Will ignore element factories: '%s'", STATE_IGNORE_ELEMENTS);
ignorelist = g_strsplit (STATE_IGNORE_ELEMENTS, " ", 0);
}
plugins = gst_registry_get_plugin_list (gst_registry_get_default ());
@ -51,13 +58,22 @@ GST_START_TEST (test_state_changes)
for (f = features; f; f = f->next) {
GstPluginFeature *feature = f->data;
const gchar *name = gst_plugin_feature_get_name (feature);
gboolean ignore = FALSE;
if (!GST_IS_ELEMENT_FACTORY (feature))
continue;
if (g_str_has_prefix (name, "cdparanoia") ||
g_str_has_prefix (name, "cdio")) {
continue;
if (ignorelist) {
gchar **s;
for (s = ignorelist; s && *s; ++s) {
if (g_str_has_prefix (name, *s)) {
GST_DEBUG ("ignoring element %s", name);
ignore = TRUE;
}
}
if (ignore)
continue;
}
GST_DEBUG ("testing element %s", name);
@ -82,6 +98,7 @@ GST_START_TEST (test_state_changes)
gst_object_unref (GST_OBJECT (element));
}
}
g_strfreev (ignorelist);
}
GST_END_TEST;