gstreamer-full: add unit test

This test allows to test gstreamer-full behaviour

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/203>
This commit is contained in:
Stéphane Cerveau 2020-07-16 18:13:50 +02:00
parent b25e471eaf
commit bda7145460
6 changed files with 27 additions and 25 deletions

View file

@ -1,19 +0,0 @@
#include <gst/gst.h>
int
main (int argc, char *argv[])
{
GstElement *e;
gst_init (&argc, &argv);
e = gst_element_factory_make ("identity", NULL);
g_assert_nonnull (e);
g_object_unref (e);
e = gst_element_factory_make ("alpha", NULL);
g_assert_nonnull (e);
g_object_unref (e);
return 0;
}

View file

@ -1,6 +0,0 @@
project('myapp', 'c')
dep = dependency('gstreamer-full-1.0')
app = executable('myapp', 'main.c', dependencies : dep)
test('test-gstreamer-full', app)

View file

@ -337,6 +337,9 @@ foreach custom_subproj: get_option('custom_subprojects').split(',')
endforeach endforeach
message('Building subprojects: ' + ', '.join(subprojects_names)) message('Building subprojects: ' + ', '.join(subprojects_names))
subdir('tests')
setenv = find_program('gst-env.py') setenv = find_program('gst-env.py')
devenv_cmd = [setenv, '--builddir=@0@'.format(meson.build_root()), devenv_cmd = [setenv, '--builddir=@0@'.format(meson.build_root()),

4
tests/meson.build Normal file
View file

@ -0,0 +1,4 @@
if get_option('tests').disabled()
subdir_done()
endif
subdir('static-plugins')

View file

@ -0,0 +1,6 @@
dep = dependency('gstreamer-full-1.0', required: get_option('default_library') == 'static')
if dep.found()
test_elements = executable('test-gst-full', 'test-gst-full.c', dependencies : gst_full_dep)
test('test-gst-full', test_elements)
endif

View file

@ -0,0 +1,14 @@
#include <gst/gst.h>
int
main (int argc, char *argv[])
{
GstElement *e;
gst_init (&argc, &argv);
e = gst_element_factory_make ("pipeline", NULL);
g_assert_nonnull (e);
g_object_unref (e);
}