Commit c0d40737 authored by Thibault Saunier's avatar Thibault Saunier
Browse files

tests: Fix the way we get tests assets

Using __FILE__ won't work properly with meson.
parent 8b4983da
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 = \
......
......@@ -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;
cfile = g_file_new_for_path (__FILE__);
fdir = g_file_get_parent (cfile);
gchar *path, *uri;
f = g_file_get_child (fdir, filename);
uri = g_file_get_uri (f);
path = g_build_filename (GES_TEST_FILES_PATH, filename, NULL);
uri = gst_filename_to_uri (path, NULL);
gst_object_unref (cfile);
gst_object_unref (fdir);
gst_object_unref (f);
g_free (path);
return uri;
}
......
......@@ -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',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment