tests: Simplifie integration tests using macros all around

This commit is contained in:
Thibault Saunier 2013-07-12 19:44:46 -04:00
parent b7755493e1
commit 125141237f

View file

@ -255,7 +255,7 @@ check_rendered_file_properties (GstClockTime duration)
/* Test seeking in various situations */ /* Test seeking in various situations */
static void static void
_seeking_playback (void) test_seeking (gboolean render)
{ {
GESTimeline *timeline; GESTimeline *timeline;
GESLayer *layer; GESLayer *layer;
@ -297,34 +297,6 @@ _seeking_playback (void)
fail_unless (test_timeline_with_profile (timeline, PROFILE_OGG, FALSE)); fail_unless (test_timeline_with_profile (timeline, PROFILE_OGG, FALSE));
} }
GST_START_TEST (test_seeking_playback_webm)
{
testfilename1 = "test1.webm";
testfilename2 = "test2.webm";
_seeking_playback ();
}
GST_END_TEST;
GST_START_TEST (test_seeking_playback_ogv)
{
testfilename1 = "test1.ogv";
testfilename2 = "test2.ogv";
_seeking_playback ();
}
GST_END_TEST;
GST_START_TEST (test_seeking_playback_mov)
{
testfilename1 = "test1.MOV";
testfilename2 = "test2.MOV";
_seeking_playback ();
}
GST_END_TEST;
/* Test adding an effect [E] marks the effect */ /* Test adding an effect [E] marks the effect */
static void static void
test_effect (gboolean render) test_effect (gboolean render)
@ -504,201 +476,50 @@ test_image (gboolean render)
fail_unless (check_rendered_file_properties (1 * GST_SECOND)); fail_unless (check_rendered_file_properties (1 * GST_SECOND));
} }
GST_START_TEST (test_basic_render_webm) #define CREATE_TEST(name, func, render) \
{ GST_START_TEST (test_##name##_mov ) \
testfilename1 = "test1.webm"; { \
testfilename2 = "test2.webm"; testfilename1 = "test1.MOV"; \
test_image_filename = "test.png"; testfilename2 = "test2.MOV"; \
test_basic (TRUE); func (render); \
} } \
GST_END_TEST; \
GST_START_TEST (test_##name##_ogv ) \
{ \
testfilename1 = "test1.ogv"; \
testfilename2 = "test2.ogv"; \
func (render); \
} \
GST_END_TEST; \
GST_START_TEST (test_##name##_webm ) \
{ \
testfilename1 = "test1.webm"; \
testfilename2 = "test2.webm"; \
func (render); \
} \
GST_END_TEST; GST_END_TEST;
GST_START_TEST (test_basic_playback_webm) #define ADD_TESTS(name) \
{ tcase_add_test (tc_chain, test_##name##_webm); \
testfilename1 = "test1.webm"; tcase_add_test (tc_chain, test_##name##_ogv); \
testfilename2 = "test2.webm"; tcase_add_test (tc_chain, test_##name##_mov); \
test_image_filename = "test.png";
test_basic (FALSE);
}
GST_END_TEST;
GST_START_TEST (test_effect_render_webm)
{
testfilename1 = "test1.webm";
testfilename2 = "test2.webm";
test_image_filename = "test.png";
test_effect (TRUE);
}
GST_END_TEST; /* *INDENT-OFF* */
CREATE_TEST(basic_playback, test_basic, FALSE)
CREATE_TEST(basic_render, test_basic, TRUE)
GST_START_TEST (test_effect_playback_webm) CREATE_TEST(transition_playback, test_transition, FALSE)
{ CREATE_TEST(transition_render, test_transition, TRUE)
testfilename1 = "test1.webm";
testfilename2 = "test2.webm";
test_image_filename = "test.png";
test_effect (FALSE);
}
GST_END_TEST; CREATE_TEST(effect_playback, test_effect, FALSE)
CREATE_TEST(effect_render, test_effect, TRUE)
GST_START_TEST (test_transition_render_webm) CREATE_TEST(seeking_playback, test_seeking, FALSE)
{
testfilename1 = "test1.webm";
testfilename2 = "test2.webm";
test_image_filename = "test.png";
test_transition (TRUE);
}
GST_END_TEST; CREATE_TEST(image_playback, test_image, FALSE)
/* *INDENT-ON* */
GST_START_TEST (test_transition_playback_webm)
{
testfilename1 = "test1.webm";
testfilename2 = "test2.webm";
test_image_filename = "test.png";
test_transition (FALSE);
}
GST_END_TEST;
GST_START_TEST (test_image_playback_webm)
{
testfilename1 = "test1.webm";
testfilename2 = "test2.webm";
test_image_filename = "test.png";
test_image (FALSE);
}
GST_END_TEST;
GST_START_TEST (test_basic_render_ogv)
{
testfilename1 = "test1.ogv";
testfilename2 = "test2.ogv";
test_basic (TRUE);
}
GST_END_TEST;
GST_START_TEST (test_basic_playback_ogv)
{
testfilename1 = "test1.ogv";
testfilename2 = "test2.ogv";
test_basic (FALSE);
}
GST_END_TEST;
GST_START_TEST (test_effect_render_ogv)
{
testfilename1 = "test1.ogv";
testfilename2 = "test2.ogv";
test_effect (TRUE);
}
GST_END_TEST;
GST_START_TEST (test_effect_playback_ogv)
{
testfilename1 = "test1.ogv";
testfilename2 = "test2.ogv";
test_effect (FALSE);
}
GST_END_TEST;
GST_START_TEST (test_transition_render_ogv)
{
testfilename1 = "test1.ogv";
testfilename2 = "test2.ogv";
test_transition (TRUE);
}
GST_END_TEST;
GST_START_TEST (test_transition_playback_ogv)
{
testfilename1 = "test1.ogv";
testfilename2 = "test2.ogv";
test_transition (FALSE);
}
GST_END_TEST;
GST_START_TEST (test_image_playback_ogv)
{
testfilename1 = "test1.ogv";
testfilename2 = "test2.ogv";
test_image (FALSE);
}
GST_END_TEST;
GST_START_TEST (test_basic_render_mov)
{
testfilename1 = "test1.MOV";
testfilename2 = "test2.MOV";
test_basic (TRUE);
}
GST_END_TEST;
GST_START_TEST (test_basic_playback_mov)
{
testfilename1 = "test1.MOV";
testfilename2 = "test2.MOV";
test_basic (FALSE);
}
GST_END_TEST;
GST_START_TEST (test_effect_render_mov)
{
testfilename1 = "test1.MOV";
testfilename2 = "test2.MOV";
test_effect (TRUE);
}
GST_END_TEST;
GST_START_TEST (test_effect_playback_mov)
{
testfilename1 = "test1.MOV";
testfilename2 = "test2.MOV";
test_effect (FALSE);
}
GST_END_TEST;
GST_START_TEST (test_transition_render_mov)
{
testfilename1 = "test1.MOV";
testfilename2 = "test2.MOV";
test_transition (TRUE);
}
GST_END_TEST;
GST_START_TEST (test_transition_playback_mov)
{
testfilename1 = "test1.MOV";
testfilename2 = "test2.MOV";
test_transition (FALSE);
}
GST_END_TEST;
GST_START_TEST (test_image_playback_mov)
{
testfilename1 = "test1.MOV";
testfilename2 = "test2.MOV";
test_image (FALSE);
}
GST_END_TEST;
static Suite * static Suite *
ges_suite (void) ges_suite (void)
@ -708,37 +529,18 @@ ges_suite (void)
suite_add_tcase (s, tc_chain); suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_basic_render_webm); ADD_TESTS (basic_playback);
tcase_add_test (tc_chain, test_basic_render_ogv); ADD_TESTS (basic_render);
tcase_add_test (tc_chain, test_basic_render_mov);
tcase_add_test (tc_chain, test_basic_playback_webm); ADD_TESTS (effect_render);
tcase_add_test (tc_chain, test_basic_playback_ogv); ADD_TESTS (effect_playback);
tcase_add_test (tc_chain, test_basic_playback_mov);
tcase_add_test (tc_chain, test_effect_render_webm); ADD_TESTS (transition_render);
tcase_add_test (tc_chain, test_effect_render_ogv); ADD_TESTS (transition_playback);
tcase_add_test (tc_chain, test_effect_render_mov);
tcase_add_test (tc_chain, test_effect_playback_webm); ADD_TESTS (image_playback);
tcase_add_test (tc_chain, test_effect_playback_ogv);
tcase_add_test (tc_chain, test_effect_playback_mov);
tcase_add_test (tc_chain, test_transition_render_webm); ADD_TESTS (seeking_playback);
tcase_add_test (tc_chain, test_transition_render_ogv);
tcase_add_test (tc_chain, test_transition_render_mov);
tcase_add_test (tc_chain, test_transition_playback_webm);
tcase_add_test (tc_chain, test_transition_playback_ogv);
tcase_add_test (tc_chain, test_transition_playback_mov);
tcase_add_test (tc_chain, test_image_playback_webm);
tcase_add_test (tc_chain, test_image_playback_ogv);
tcase_add_test (tc_chain, test_image_playback_mov);
tcase_add_test (tc_chain, test_seeking_playback_webm);
tcase_add_test (tc_chain, test_seeking_playback_ogv);
tcase_add_test (tc_chain, test_seeking_playback_mov);
/* TODO : next test case : complex timeline created from project. */ /* TODO : next test case : complex timeline created from project. */
/* TODO : deep checking of rendered clips */ /* TODO : deep checking of rendered clips */