tests: Fix the way we get tests assets

Using __FILE__ won't work properly with meson.
This commit is contained in:
Thibault Saunier 2016-09-09 16:42:13 -03:00
parent 8b4983daf1
commit c0d40737a9
3 changed files with 9 additions and 25 deletions

View file

@ -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 = \

View file

@ -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;
}

View file

@ -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',