gboolean _gst_check_raised_critical = FALSE;
gboolean _gst_check_raised_warning = FALSE;
gboolean _gst_check_expecting_log = FALSE;
+gboolean _gst_check_list_tests = FALSE;
static void gst_check_log_message_func
(const gchar * log_domain, GLogLevelFlags log_level,
gst_plugin_list_free (plugins);
}
-/* initialize GStreamer testing */
+/* gst_check_init:
+ * @argc: (inout) (allow-none): pointer to application's argc
+ * @argv: (inout) (array length=argc) (allow-none): pointer to application's argv
+ *
+ * Tnitialize GStreamer testing
+ *
+ * NOTE: Needs to be called before creating the testsuite
+ * so that the tests can be listed.
+ * */
void
gst_check_init (int *argc, char **argv[])
{
guint timeout_multiplier = 1;
-
- gst_init (argc, argv);
+ GOptionContext *ctx;
+ GError *err = NULL;
+ GOptionEntry options[] = {
+ {"list-tests", 'l', 0, G_OPTION_ARG_NONE, &_gst_check_list_tests,
+ "List tests present in the testsuite", NULL},
+ {NULL}
+ };
+
+ ctx = g_option_context_new ("gst-check");
+ g_option_context_add_main_entries (ctx, options, NULL);
+ g_option_context_add_group (ctx, gst_init_get_option_group ());
+
+ if (!g_option_context_parse (ctx, argc, argv, &err)) {
+ if (err)
+ g_printerr ("Error initializing: %s\n", GST_STR_NULL (err->message));
+ else
+ g_printerr ("Error initializing: Unknown error!\n");
+ g_clear_error (&err);
+ g_option_context_free (ctx);
+ }
+ g_option_context_free (ctx);
GST_DEBUG_CATEGORY_INIT (check_debug, "check", 0, "check regression tests");
extern gboolean _gst_check_raised_critical;
extern gboolean _gst_check_raised_warning;
extern gboolean _gst_check_expecting_log;
+extern gboolean _gst_check_list_tests;
/* global variables used in test methods */
extern GList * buffers;
GstStaticPadTemplate * tmpl);
GstPad *gst_check_setup_sink_pad_from_template (GstElement * element,
GstPadTemplate * tmpl);
-GstPad * gst_check_setup_sink_pad_by_name (GstElement * element,
+GstPad * gst_check_setup_sink_pad_by_name (GstElement * element,
GstStaticPadTemplate * tmpl, const gchar *name);
-GstPad * gst_check_setup_sink_pad_by_name_from_template (GstElement * element,
+GstPad * gst_check_setup_sink_pad_by_name_from_template (GstElement * element,
GstPadTemplate * tmpl, const gchar *name);
void gst_check_teardown_pad_by_name (GstElement * element, const gchar *name);
void gst_check_teardown_src_pad (GstElement * element);
__gst_tcase_add_test (TCase * tc, TFun tf, const char * fname, int signal,
int allowed_exit_value, int start, int end)
{
- if (_gst_check_run_test_func (fname)) {
- _tcase_add_test (tc, tf, fname, signal, allowed_exit_value, start, end);
- }
+ if (_gst_check_list_tests) {
+ g_print ("Test: %s\n", fname);
+ return;
+ }
+
+ if (_gst_check_run_test_func (fname)) {
+ _tcase_add_test (tc, tf, fname, signal, allowed_exit_value, start, end);
+ }
}
#define _tcase_add_test __gst_tcase_add_test
-/* A special variant to add broken tests. These are normally skipped, but can be
+/* A special variant to add broken tests. These are normally skipped, but can be
* forced to run via GST_CHECKS */
#define tcase_skip_broken_test(chain,test_func) \
G_STMT_START { \