summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStéphane Cerveau <scerveau@collabora.com>2020-07-16 18:13:50 +0200
committerStéphane Cerveau <scerveau@collabora.com>2020-10-12 10:27:55 +0200
commitbda71454601340a0f4e496c90f961e016df853b4 (patch)
tree82b5c9525eca9cd77c60fc65d34c7d3cd0494b1d
parentb25e471eafafeab1b1cddb4a029d1976e0ad61db (diff)
downloadgstreamer-bda71454601340a0f4e496c90f961e016df853b4.tar.gz
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>
-rw-r--r--examples/static-plugins/main.c19
-rw-r--r--examples/static-plugins/meson.build6
-rw-r--r--meson.build3
-rw-r--r--tests/meson.build4
-rw-r--r--tests/static-plugins/meson.build6
-rw-r--r--tests/static-plugins/test-gst-full.c14
6 files changed, 27 insertions, 25 deletions
diff --git a/examples/static-plugins/main.c b/examples/static-plugins/main.c
deleted file mode 100644
index 1917726f25..0000000000
--- a/examples/static-plugins/main.c
+++ /dev/null
@@ -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;
-}
diff --git a/examples/static-plugins/meson.build b/examples/static-plugins/meson.build
deleted file mode 100644
index 0273086be9..0000000000
--- a/examples/static-plugins/meson.build
+++ /dev/null
@@ -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)
diff --git a/meson.build b/meson.build
index 39a336a77c..3a187b111e 100644
--- a/meson.build
+++ b/meson.build
@@ -337,6 +337,9 @@ foreach custom_subproj: get_option('custom_subprojects').split(',')
endforeach
message('Building subprojects: ' + ', '.join(subprojects_names))
+
+subdir('tests')
+
setenv = find_program('gst-env.py')
devenv_cmd = [setenv, '--builddir=@0@'.format(meson.build_root()),
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 0000000000..6884250f76
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,4 @@
+if get_option('tests').disabled()
+ subdir_done()
+endif
+subdir('static-plugins')
diff --git a/tests/static-plugins/meson.build b/tests/static-plugins/meson.build
new file mode 100644
index 0000000000..37b133672f
--- /dev/null
+++ b/tests/static-plugins/meson.build
@@ -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
diff --git a/tests/static-plugins/test-gst-full.c b/tests/static-plugins/test-gst-full.c
new file mode 100644
index 0000000000..6ba1a2ab40
--- /dev/null
+++ b/tests/static-plugins/test-gst-full.c
@@ -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);
+
+}