From cf96e4145e16091b5ea15309c4136787992ed453 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sat, 24 Aug 2013 02:41:07 -0400 Subject: [PATCH] tests: Fix make distcheck We need to make sure that we can write to the directory where we save project files, so doing it in the tmp folder. + Properly dist test data files --- tests/check/Makefile.am | 1 + tests/check/ges/project.c | 27 ++++++++++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index 5b8fd80e02..01497074c9 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -61,6 +61,7 @@ integration_CFLAGS = $(AM_CFLAGS) EXTRA_DIST = \ ges/test-project.xges \ ges/test-auto-transition.xges \ + ges/test-keyframes.xges \ ges/audio_only.ogg \ ges/image.png \ ges/audio_video.ogg diff --git a/tests/check/ges/project.c b/tests/check/ges/project.c index a57d8ad28c..0fb1f8e7c6 100644 --- a/tests/check/ges/project.c +++ b/tests/check/ges/project.c @@ -31,6 +31,20 @@ project_loaded_cb (GESProject * project, GESTimeline * timeline, g_main_loop_quit (mainloop); } +static gchar * +get_tmp_uri (const gchar * filename) +{ + gchar *location, *uri; + + location = g_build_filename (g_get_tmp_dir (), + "test-keyframes-save.xges", NULL); + + uri = g_strconcat ("file://", location, NULL); + g_free (location); + + return uri; +} + GST_START_TEST (test_project_simple) { gchar *id; @@ -416,8 +430,7 @@ GST_START_TEST (test_project_add_keyframes) _add_keyframes (timeline); - uri = ges_test_file_uri ("test-keyframes-save.xges"); - + uri = get_tmp_uri ("test-keyframes-save.xges"); formatter_asset = ges_asset_request (GES_TYPE_FORMATTER, "ges", NULL); saved = ges_project_save (project, timeline, uri, formatter_asset, TRUE, NULL); @@ -460,7 +473,7 @@ GST_START_TEST (test_project_load_xges) GESProject *project; GESTimeline *timeline; GESAsset *formatter_asset; - gchar *tmpuri, *uri = ges_test_file_uri ("test-project.xges"); + gchar *uri = ges_test_file_uri ("test-project.xges"); project = ges_project_new (uri); mainloop = g_main_loop_new (NULL, FALSE); @@ -485,10 +498,7 @@ GST_START_TEST (test_project_load_xges) _test_project (project, timeline); g_free (uri); - tmpuri = g_build_filename (g_get_tmp_dir (), "test-project_TMP.xges", NULL); - uri = gst_filename_to_uri (tmpuri, NULL); - g_free (tmpuri); - + uri = get_tmp_uri ("test-project_TMP.xges"); formatter_asset = ges_asset_request (GES_TYPE_FORMATTER, "ges", NULL); saved = ges_project_save (project, timeline, uri, formatter_asset, TRUE, NULL); @@ -560,8 +570,7 @@ GST_START_TEST (test_project_auto_transition) /* Set timeline and layers auto-transition to TRUE */ ges_timeline_set_auto_transition (timeline, TRUE); - tmpuri = ges_test_file_uri ("test-auto-transition-save.xges"); - + tmpuri = get_tmp_uri ("test-auto-transition-save.xges"); formatter_asset = ges_asset_request (GES_TYPE_FORMATTER, "ges", NULL); saved = ges_project_save (project, timeline, tmpuri, formatter_asset, TRUE, NULL);