diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index b9248ef10f..5aa6504e77 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -1,5 +1,6 @@ include $(top_srcdir)/common/check.mak +TEST_FILES_DIRECTORY = $(top_srcdir)/tests/check/ges REGISTRY_ENVIRONMENT = \ GST_REGISTRY_1_0=$(CHECK_REGISTRY) @@ -66,7 +67,8 @@ noinst_HEADERS=$(testutils_noinst_headers) TESTS = $(check_PROGRAMS) -AM_CFLAGS = $(common_cflags) -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS +AM_CFLAGS = $(common_cflags) -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS \ + -DGES_TEST_FILES_PATH="\"$(TEST_FILES_DIRECTORY)\"" \ LDADD = $(common_ldadd) libtestutils.la EXTRA_DIST = \ diff --git a/tests/check/ges/test-utils.c b/tests/check/ges/test-utils.c index 86a3bfd677..fd0ff4d6ff 100644 --- a/tests/check/ges/test-utils.c +++ b/tests/check/ges/test-utils.c @@ -50,20 +50,7 @@ ges_test_get_audio_only_uri (void) gchar * ges_test_get_audio_video_uri (void) { - gchar *uri; - GFile *cfile, *fdir, *f_audio_video; - - cfile = g_file_new_for_path (__FILE__); - fdir = g_file_get_parent (cfile); - - f_audio_video = g_file_get_child (fdir, "audio_video.ogg"); - uri = g_file_get_uri (f_audio_video); - - gst_object_unref (cfile); - gst_object_unref (fdir); - gst_object_unref (f_audio_video); - - return uri; + return ges_test_file_uri ("audio_video.ogg"); } gchar * @@ -75,18 +62,12 @@ ges_test_get_image_uri (void) gchar * ges_test_file_uri (const gchar * filename) { - gchar *uri; - GFile *cfile, *fdir, *f; + gchar *path, *uri; - cfile = g_file_new_for_path (__FILE__); - fdir = g_file_get_parent (cfile); + path = g_build_filename (GES_TEST_FILES_PATH, filename, NULL); + uri = gst_filename_to_uri (path, NULL); - f = g_file_get_child (fdir, filename); - uri = g_file_get_uri (f); - - gst_object_unref (cfile); - gst_object_unref (fdir); - gst_object_unref (f); + g_free (path); return uri; } diff --git a/tests/check/meson.build b/tests/check/meson.build index dca7a8853e..4434c5623c 100644 --- a/tests/check/meson.build +++ b/tests/check/meson.build @@ -27,6 +27,7 @@ ges_tests = [ test_defines = [ '-UG_DISABLE_ASSERT', '-UG_DISABLE_CAST_CHECKS', + '-DGES_TEST_FILES_PATH="' + meson.current_source_dir() + '/ges/"', '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"', '-DTESTFILE="' + meson.current_source_dir() + '/meson.build"', '-DGST_USE_UNSTABLE_API',