+2006-07-01 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ * libs/gst/check/gstcheck.c: (gst_check_run_suite):
+ * libs/gst/check/gstcheck.h:
+ create a macro and function so that the simple unit test
+ case can be just one macro to create main()
+
2006-06-30 Tim-Philipp Müller <tim at centricular dot net>
* gst/gstbin.c: (gst_bin_restore_thyself):
-Subproject commit 123195d3bbcc0b6e1cf867d3a180685f8766a0be
+Subproject commit f4348ab157cc5e859f287e746004c0210880969a
*
* Common code for GStreamer unittests
*
- * Copyright (C) <2004> Thomas Vander Stichele <thomas at apestaart dot org>
+ * Copyright (C) 2004,2006 Thomas Vander Stichele <thomas at apestaart dot org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
}
}
}
+
+gint
+gst_check_run_suite (Suite * suite, const gchar * name, const gchar * fname)
+{
+ gint nf;
+
+ SRunner *sr = srunner_create (suite);
+
+ if (g_getenv ("GST_CHECK_XML")) {
+ /* how lucky we are to have __FILE__ end in .c */
+ gchar *xmlfilename = g_strdup_printf ("%sheck.xml", fname);
+
+ srunner_set_xml (sr, xmlfilename);
+ }
+
+ srunner_run_all (sr, CK_NORMAL);
+ nf = srunner_ntests_failed (sr);
+ srunner_free (sr);
+ return nf;
+}
GstStaticPadTemplate *template, GstCaps *caps);
void gst_check_teardown_sink_pad (GstElement *element);
void gst_check_abi_list (GstCheckABIStruct list[], gboolean have_abi_sizes);
-
-
+gint gst_check_run_suite (Suite *suite, const gchar *name, const gchar *fname);
#define fail_unless_message_error(msg, domain, code) \
gst_check_message_error (msg, GST_MESSAGE_ERROR, \
#endif /* __GST_CHECK_H__ */
+#define GST_CHECK_MAIN(name) \
+int main (int argc, char **argv) \
+{ \
+ Suite *s = name ## _suite (); \
+ gst_check_init (&argc, &argv); \
+ return gst_check_run_suite (s, # name, __FILE__); \
+}