static GstElement *camera;
static GMainLoop *main_loop;
+guint32 test_id = 0;
/* helper function for filenames */
static const gchar *
* multifilesink like location */
if (num == -1) {
g_snprintf (file_name, 999, "%s" G_DIR_SEPARATOR_S
- "gstcamerabin2test_%s_%%03d.cap", g_get_tmp_dir (), base_name);
+ "gstcamerabin2test_%s_%u_%%03d.cap", g_get_tmp_dir (), base_name,
+ test_id);
} else {
g_snprintf (file_name, 999, "%s" G_DIR_SEPARATOR_S
- "gstcamerabin2test_%s_%03d.cap", g_get_tmp_dir (), base_name, num);
+ "gstcamerabin2test_%s_%u_%03d.cap", g_get_tmp_dir (), base_name,
+ test_id, num);
}
GST_INFO ("capturing to: %s", file_name);
}
static void
-setup (void)
+setup_wrappercamerabinsrc_videotestsrc (void)
{
GstBus *bus;
GstElement *vfbin;
GST_INFO ("init");
+ test_id = g_random_int ();
+
main_loop = g_main_loop_new (NULL, TRUE);
camera = gst_check_setup_element ("camerabin2");
GST_END_TEST;
+
+typedef struct _TestCaseDef
+{
+ const gchar *name;
+ gpointer setup_func;
+} TestCaseDef;
+
+TestCaseDef tests[] = {
+ {"wrappercamerabinsrc", setup_wrappercamerabinsrc_videotestsrc}
+};
+
static Suite *
camerabin_suite (void)
{
Suite *s = suite_create ("camerabin2");
- TCase *tc_basic = tcase_create ("general");
-
- /* Test that basic operations run without errors */
- suite_add_tcase (s, tc_basic);
- /* Increase timeout due to video recording */
- tcase_set_timeout (tc_basic, 60);
- tcase_add_checked_fixture (tc_basic, setup, teardown);
- tcase_add_test (tc_basic, test_single_image_capture);
- tcase_add_test (tc_basic, test_single_video_recording);
- tcase_add_test (tc_basic, test_image_video_cycle);
- tcase_add_test (tc_basic, test_multiple_image_captures);
- tcase_add_test (tc_basic, test_supported_caps);
+ gint i;
+ TCase *tc_generic = tcase_create ("generic");
+
+ suite_add_tcase (s, tc_generic);
+ tcase_add_checked_fixture (tc_generic, setup_wrappercamerabinsrc_videotestsrc,
+ teardown);
+ tcase_add_test (tc_generic, test_supported_caps);
+
+ for (i = 0; i < G_N_ELEMENTS (tests); i++) {
+ TCase *tc_basic = tcase_create (tests[i].name);
+ suite_add_tcase (s, tc_basic);
+
+ /* Increase timeout due to video recording */
+ tcase_set_timeout (tc_basic, 60);
+ tcase_add_checked_fixture (tc_basic, tests[i].setup_func, teardown);
+
+ tcase_add_test (tc_basic, test_single_image_capture);
+ tcase_add_test (tc_basic, test_single_video_recording);
+ tcase_add_test (tc_basic, test_image_video_cycle);
+ tcase_add_test (tc_basic, test_multiple_image_captures);
+ }
return s;
}