summaryrefslogtreecommitdiffstats
path: root/recipes-multimedia/gstreamer/gstreamer1.0
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-multimedia/gstreamer/gstreamer1.0')
-rw-r--r--recipes-multimedia/gstreamer/gstreamer1.0/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch69
-rw-r--r--recipes-multimedia/gstreamer/gstreamer1.0/0001-tests-respect-the-idententaion-used-in-meson.patch (renamed from recipes-multimedia/gstreamer/gstreamer1.0/0004-tests-respect-the-idententaion-used-in-meson.patch)14
-rw-r--r--recipes-multimedia/gstreamer/gstreamer1.0/0002-Remove-unused-valgrind-detection.patch110
-rw-r--r--recipes-multimedia/gstreamer/gstreamer1.0/0002-tests-add-support-for-install-the-tests.patch (renamed from recipes-multimedia/gstreamer/gstreamer1.0/0005-tests-add-support-for-install-the-tests.patch)67
-rw-r--r--recipes-multimedia/gstreamer/gstreamer1.0/0003-tests-seek-Don-t-use-too-strict-timeout-for-validati.patch32
-rw-r--r--recipes-multimedia/gstreamer/gstreamer1.0/0003-tests-use-a-dictionaries-for-environment.patch (renamed from recipes-multimedia/gstreamer/gstreamer1.0/0006-tests-use-a-dictionaries-for-environment.patch)28
-rw-r--r--recipes-multimedia/gstreamer/gstreamer1.0/0004-tests-add-helper-script-to-run-the-installed_tests.patch74
-rw-r--r--recipes-multimedia/gstreamer/gstreamer1.0/0005-tests-remove-gstbin-test_watch_for_state_change-test.patch107
-rw-r--r--recipes-multimedia/gstreamer/gstreamer1.0/0007-tests-install-the-environment-for-installed_tests.patch58
9 files changed, 236 insertions, 323 deletions
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch b/recipes-multimedia/gstreamer/gstreamer1.0/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch
deleted file mode 100644
index 23ebd5c6..00000000
--- a/recipes-multimedia/gstreamer/gstreamer1.0/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch
+++ /dev/null
@@ -1,69 +0,0 @@
1From fd8f49dba8c09d47425da80f5faab3bfa4a7c962 Mon Sep 17 00:00:00 2001
2From: Jose Quaresma <quaresma.jose@gmail.com>
3Date: Sat, 10 Oct 2020 19:09:03 +0000
4Subject: [PATCH 1/3] gstpluginloader: when env var is set do not fall through
5 to system plugin scanner
6
7If we set a custom GST_PLUGIN_SCANNER env var, then we probably want to use that and only that.
8
9Falling through to the one installed on the system is problamatic in cross-compilation
10environemnts, regardless of whether one pointed to by the env var succeeded or failed.
11
12taken from:
13http://cgit.openembedded.org/openembedded-core/commit/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch?id=0db7ba34ca41b107042306d13a6f0162885c123b
14
15Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/669>
16
17Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/9f958058697e6fbf5bde325228034572331d1a3a]
18
19Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
20---
21 gst/gstpluginloader.c | 15 +++++++--------
22 1 file changed, 7 insertions(+), 8 deletions(-)
23
24diff --git a/gst/gstpluginloader.c b/gst/gstpluginloader.c
25index d1e404d98..c626bf263 100644
26--- a/gst/gstpluginloader.c
27+++ b/gst/gstpluginloader.c
28@@ -464,20 +464,19 @@ gst_plugin_loader_spawn (GstPluginLoader * loader)
29 if (loader->child_running)
30 return TRUE;
31
32- /* Find the gst-plugin-scanner: first try the env-var if it is set,
33- * otherwise use the installed version */
34+ /* Find the gst-plugin-scanner */
35 env = g_getenv ("GST_PLUGIN_SCANNER_1_0");
36 if (env == NULL)
37 env = g_getenv ("GST_PLUGIN_SCANNER");
38
39 if (env != NULL && *env != '\0') {
40+ /* use the env-var if it is set */
41 GST_LOG ("Trying GST_PLUGIN_SCANNER env var: %s", env);
42 helper_bin = g_strdup (env);
43 res = gst_plugin_loader_try_helper (loader, helper_bin);
44 g_free (helper_bin);
45- }
46-
47- if (!res) {
48+ } else {
49+ /* use the installed version */
50 GST_LOG ("Trying installed plugin scanner");
51
52 #ifdef G_OS_WIN32
53@@ -497,10 +496,10 @@ gst_plugin_loader_spawn (GstPluginLoader * loader)
54 #endif
55 res = gst_plugin_loader_try_helper (loader, helper_bin);
56 g_free (helper_bin);
57+ }
58
59- if (!res) {
60- GST_INFO ("No gst-plugin-scanner available, or not working");
61- }
62+ if (!res) {
63+ GST_INFO ("No gst-plugin-scanner available, or not working");
64 }
65
66 return loader->child_running;
67--
682.29.2
69
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0/0004-tests-respect-the-idententaion-used-in-meson.patch b/recipes-multimedia/gstreamer/gstreamer1.0/0001-tests-respect-the-idententaion-used-in-meson.patch
index 6f571a12..312c04fb 100644
--- a/recipes-multimedia/gstreamer/gstreamer1.0/0004-tests-respect-the-idententaion-used-in-meson.patch
+++ b/recipes-multimedia/gstreamer/gstreamer1.0/0001-tests-respect-the-idententaion-used-in-meson.patch
@@ -1,4 +1,4 @@
1From 122e5ac3dd16a461b6ae595605490c8f5d1c3a9d Mon Sep 17 00:00:00 2001 1From 1eb77a4ea5a3967c688d8f1192f99c605badc7e2 Mon Sep 17 00:00:00 2001
2From: Jose Quaresma <quaresma.jose@gmail.com> 2From: Jose Quaresma <quaresma.jose@gmail.com>
3Date: Sun, 11 Apr 2021 19:48:13 +0100 3Date: Sun, 11 Apr 2021 19:48:13 +0100
4Subject: [PATCH 1/4] tests: respect the idententaion used in meson 4Subject: [PATCH 1/4] tests: respect the idententaion used in meson
@@ -7,13 +7,13 @@ Upstream-Status: Submitted [https://gitlab.freedesktop.org/gstreamer/gstreamer/-
7 7
8Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> 8Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
9--- 9---
10 tests/check/meson.build | 10 +++++----- 10 subprojects/gstreamer/tests/check/meson.build | 10 +++++-----
11 1 file changed, 5 insertions(+), 5 deletions(-) 11 1 file changed, 5 insertions(+), 5 deletions(-)
12 12
13diff --git a/tests/check/meson.build b/tests/check/meson.build 13diff --git a/subprojects/gstreamer/tests/check/meson.build b/subprojects/gstreamer/tests/check/meson.build
14index a617cf159..b2636714b 100644 14index 9c4228b6e4..506606684d 100644
15--- a/tests/check/meson.build 15--- a/subprojects/gstreamer/tests/check/meson.build
16+++ b/tests/check/meson.build 16+++ b/subprojects/gstreamer/tests/check/meson.build
17@@ -146,11 +146,11 @@ foreach t : core_tests 17@@ -146,11 +146,11 @@ foreach t : core_tests
18 18
19 if not skip_test 19 if not skip_test
@@ -32,5 +32,5 @@ index a617cf159..b2636714b 100644
32 32
33 env = environment() 33 env = environment()
34-- 34--
352.31.1 352.33.1
36 36
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0/0002-Remove-unused-valgrind-detection.patch b/recipes-multimedia/gstreamer/gstreamer1.0/0002-Remove-unused-valgrind-detection.patch
deleted file mode 100644
index 5805e8b6..00000000
--- a/recipes-multimedia/gstreamer/gstreamer1.0/0002-Remove-unused-valgrind-detection.patch
+++ /dev/null
@@ -1,110 +0,0 @@
1From d7f05d09c55d35bbe4e0f856759519ef183d9a56 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim@centricular.com>
3Date: Fri, 14 Aug 2020 16:38:26 +0100
4Subject: [PATCH] Remove unused valgrind detection
5
6Having this just to log a debug message in case we're
7running inside valgrind doesn't seem very useful, and
8the code that used to use this no longer exists it seems.
9
10Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/595>
11
12Upstream-Status: Backport [a2cbf75523cdf8a4df1baa7007d86ef455972245]
13
14Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
15
16---
17 gst/gst_private.h | 2 --
18 gst/gstinfo.c | 39 ---------------------------------------
19 meson.build | 1 -
20 3 files changed, 42 deletions(-)
21
22diff --git a/gst/gst_private.h b/gst/gst_private.h
23index eefd044d9..8252ede51 100644
24--- a/gst/gst_private.h
25+++ b/gst/gst_private.h
26@@ -116,8 +116,6 @@ G_GNUC_INTERNAL gboolean _priv_plugin_deps_env_vars_changed (GstPlugin * plugin
27
28 G_GNUC_INTERNAL gboolean _priv_plugin_deps_files_changed (GstPlugin * plugin);
29
30-G_GNUC_INTERNAL gboolean _priv_gst_in_valgrind (void);
31-
32 /* init functions called from gst_init(). */
33 G_GNUC_INTERNAL void _priv_gst_quarks_initialize (void);
34 G_GNUC_INTERNAL void _priv_gst_mini_object_initialize (void);
35diff --git a/gst/gstinfo.c b/gst/gstinfo.c
36index eea1a219d..d3035d6db 100644
37--- a/gst/gstinfo.c
38+++ b/gst/gstinfo.c
39@@ -305,36 +305,6 @@ static gboolean pretty_tags = PRETTY_TAGS_DEFAULT;
40 static gint G_GNUC_MAY_ALIAS __default_level = GST_LEVEL_DEFAULT;
41 static gint G_GNUC_MAY_ALIAS __use_color = GST_DEBUG_COLOR_MODE_ON;
42
43-/* FIXME: export this? */
44-gboolean
45-_priv_gst_in_valgrind (void)
46-{
47- static enum
48- {
49- GST_VG_UNCHECKED,
50- GST_VG_NO_VALGRIND,
51- GST_VG_INSIDE
52- }
53- in_valgrind = GST_VG_UNCHECKED;
54-
55- if (in_valgrind == GST_VG_UNCHECKED) {
56-#ifdef HAVE_VALGRIND_VALGRIND_H
57- if (RUNNING_ON_VALGRIND) {
58- GST_CAT_INFO (GST_CAT_GST_INIT, "we're running inside valgrind");
59- in_valgrind = GST_VG_INSIDE;
60- } else {
61- GST_CAT_LOG (GST_CAT_GST_INIT, "not doing extra valgrind stuff");
62- in_valgrind = GST_VG_NO_VALGRIND;
63- }
64-#else
65- in_valgrind = GST_VG_NO_VALGRIND;
66-#endif
67- g_assert (in_valgrind == GST_VG_NO_VALGRIND ||
68- in_valgrind == GST_VG_INSIDE);
69- }
70- return (in_valgrind == GST_VG_INSIDE);
71-}
72-
73 static gchar *
74 _replace_pattern_in_gst_debug_file_name (gchar * name, const char *token,
75 guint val)
76@@ -463,9 +433,6 @@ _priv_gst_debug_init (void)
77 _priv_GST_CAT_PROTECTION =
78 _gst_debug_category_new ("GST_PROTECTION", 0, "protection");
79
80- /* print out the valgrind message if we're in valgrind */
81- _priv_gst_in_valgrind ();
82-
83 env = g_getenv ("GST_DEBUG_OPTIONS");
84 if (env != NULL) {
85 if (strstr (env, "full_tags") || strstr (env, "full-tags"))
86@@ -2505,12 +2472,6 @@ gst_debug_construct_win_color (guint colorinfo)
87 return 0;
88 }
89
90-gboolean
91-_priv_gst_in_valgrind (void)
92-{
93- return FALSE;
94-}
95-
96 void
97 _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
98 const gchar * func, gint line, GObject * obj, const gchar * msg,
99diff --git a/meson.build b/meson.build
100index 82a17282b..42ae61790 100644
101--- a/meson.build
102+++ b/meson.build
103@@ -200,7 +200,6 @@ check_headers = [
104 'sys/wait.h',
105 'ucontext.h',
106 'unistd.h',
107- 'valgrind/valgrind.h',
108 'sys/resource.h',
109 'sys/uio.h',
110 ]
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0/0005-tests-add-support-for-install-the-tests.patch b/recipes-multimedia/gstreamer/gstreamer1.0/0002-tests-add-support-for-install-the-tests.patch
index b77fb579..d18c19c3 100644
--- a/recipes-multimedia/gstreamer/gstreamer1.0/0005-tests-add-support-for-install-the-tests.patch
+++ b/recipes-multimedia/gstreamer/gstreamer1.0/0002-tests-add-support-for-install-the-tests.patch
@@ -1,4 +1,4 @@
1From c9e93c7a3e4d2773abef4f5e1464af24f36700b3 Mon Sep 17 00:00:00 2001 1From 62f5bb7bfc2498219df7280e73480d8ed2378ce5 Mon Sep 17 00:00:00 2001
2From: Jose Quaresma <quaresma.jose@gmail.com> 2From: Jose Quaresma <quaresma.jose@gmail.com>
3Date: Sun, 11 Apr 2021 19:48:13 +0100 3Date: Sun, 11 Apr 2021 19:48:13 +0100
4Subject: [PATCH 2/4] tests: add support for install the tests 4Subject: [PATCH 2/4] tests: add support for install the tests
@@ -11,54 +11,44 @@ Upstream-Status: Submitted [https://gitlab.freedesktop.org/gstreamer/gstreamer/-
11 11
12Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> 12Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
13--- 13---
14 meson.build | 5 +++++ 14 subprojects/gstreamer/meson.build | 4 ++++
15 meson_options.txt | 1 + 15 subprojects/gstreamer/meson_options.txt | 1 +
16 template.test.in | 3 +++ 16 subprojects/gstreamer/tests/check/meson.build | 22 ++++++++++++++++++-
17 tests/check/meson.build | 22 +++++++++++++++++++++- 17 .../gstreamer/tests/check/template.test.in | 3 +++
18 4 files changed, 30 insertions(+), 1 deletion(-) 18 4 files changed, 29 insertions(+), 1 deletion(-)
19 create mode 100644 template.test.in 19 create mode 100644 subprojects/gstreamer/tests/check/template.test.in
20 20
21diff --git a/meson.build b/meson.build 21diff --git a/subprojects/gstreamer/meson.build b/subprojects/gstreamer/meson.build
22index c4e8774f5..1abf4eb26 100644 22index d20fe0040f..b595d8f990 100644
23--- a/meson.build 23--- a/subprojects/gstreamer/meson.build
24+++ b/meson.build 24+++ b/subprojects/gstreamer/meson.build
25@@ -562,6 +562,11 @@ if bashcomp_dep.found() 25@@ -562,6 +562,10 @@ if bashcomp_dep.found()
26 endif 26 endif
27 endif 27 endif
28 28
29+installed_tests_enabled = get_option('installed_tests')
29+installed_tests_metadir = join_paths(datadir, 'installed-tests', meson.project_name()) 30+installed_tests_metadir = join_paths(datadir, 'installed-tests', meson.project_name())
30+installed_tests_execdir = join_paths(libexecdir, 'installed-tests', meson.project_name()) 31+installed_tests_execdir = join_paths(libexecdir, 'installed-tests', meson.project_name())
31+installed_tests_enabled = get_option('installed-tests')
32+installed_tests_template = files('template.test.in')
33+ 32+
34 plugins_install_dir = join_paths(get_option('libdir'), 'gstreamer-1.0') 33 plugins_install_dir = join_paths(get_option('libdir'), 'gstreamer-1.0')
35 34
36 pkgconfig = import('pkgconfig') 35 pkgconfig = import('pkgconfig')
37diff --git a/meson_options.txt b/meson_options.txt 36diff --git a/subprojects/gstreamer/meson_options.txt b/subprojects/gstreamer/meson_options.txt
38index c8cee3762..b5da40eaa 100644 37index 7363bdb7a1..a34ba37dad 100644
39--- a/meson_options.txt 38--- a/subprojects/gstreamer/meson_options.txt
40+++ b/meson_options.txt 39+++ b/subprojects/gstreamer/meson_options.txt
41@@ -15,6 +15,7 @@ option('poisoning', type : 'boolean', value : false, description : 'Enable poiso 40@@ -15,6 +15,7 @@ option('poisoning', type : 'boolean', value : false, description : 'Enable poiso
42 option('memory-alignment', type: 'combo', 41 option('memory-alignment', type: 'combo',
43 choices : ['1', '2', '4', '8', '16', '32', '64', '128', '256', '512', '1024', '2048', '4096', '8192', 'malloc', 'pagesize'], 42 choices : ['1', '2', '4', '8', '16', '32', '64', '128', '256', '512', '1024', '2048', '4096', '8192', 'malloc', 'pagesize'],
44 value: 'malloc') 43 value: 'malloc')
45+option('installed-tests', type : 'boolean', value : false, description : 'Enable installed tests') 44+option('installed_tests', type : 'boolean', value : false, description : 'Enable installed tests')
46 45
47 # Feature options 46 # Feature options
48 option('check', type : 'feature', value : 'auto', description : 'Build unit test libraries') 47 option('check', type : 'feature', value : 'auto', description : 'Build unit test libraries')
49diff --git a/template.test.in b/template.test.in 48diff --git a/subprojects/gstreamer/tests/check/meson.build b/subprojects/gstreamer/tests/check/meson.build
50new file mode 100644 49index 506606684d..00a138a568 100644
51index 000000000..f701627f8 50--- a/subprojects/gstreamer/tests/check/meson.build
52--- /dev/null 51+++ b/subprojects/gstreamer/tests/check/meson.build
53+++ b/template.test.in
54@@ -0,0 +1,3 @@
55+[Test]
56+Type=session
57+Exec=@installed_tests_dir@/@program@
58diff --git a/tests/check/meson.build b/tests/check/meson.build
59index b2636714b..a697a7b06 100644
60--- a/tests/check/meson.build
61+++ b/tests/check/meson.build
62@@ -124,10 +124,16 @@ test_defines = [ 52@@ -124,10 +124,16 @@ test_defines = [
63 '-UG_DISABLE_ASSERT', 53 '-UG_DISABLE_ASSERT',
64 '-UG_DISABLE_CAST_CHECKS', 54 '-UG_DISABLE_CAST_CHECKS',
@@ -95,7 +85,7 @@ index b2636714b..a697a7b06 100644
95+ test_conf.set('installed_tests_dir', join_paths(prefix, installed_tests_execdir)) 85+ test_conf.set('installed_tests_dir', join_paths(prefix, installed_tests_execdir))
96+ test_conf.set('program', test_name) 86+ test_conf.set('program', test_name)
97+ configure_file( 87+ configure_file(
98+ input: installed_tests_template, 88+ input: 'template.test.in',
99+ output: test_name + '.test', 89+ output: test_name + '.test',
100+ install_dir: installed_tests_metadir, 90+ install_dir: installed_tests_metadir,
101+ configuration: test_conf 91+ configuration: test_conf
@@ -105,6 +95,15 @@ index b2636714b..a697a7b06 100644
105 test(test_name, exe, env: env, timeout : 3 * 60) 95 test(test_name, exe, env: env, timeout : 3 * 60)
106 endif 96 endif
107 endforeach 97 endforeach
98diff --git a/subprojects/gstreamer/tests/check/template.test.in b/subprojects/gstreamer/tests/check/template.test.in
99new file mode 100644
100index 0000000000..f701627f87
101--- /dev/null
102+++ b/subprojects/gstreamer/tests/check/template.test.in
103@@ -0,0 +1,3 @@
104+[Test]
105+Type=session
106+Exec=@installed_tests_dir@/@program@
108-- 107--
1092.31.1 1082.33.1
110 109
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0/0003-tests-seek-Don-t-use-too-strict-timeout-for-validati.patch b/recipes-multimedia/gstreamer/gstreamer1.0/0003-tests-seek-Don-t-use-too-strict-timeout-for-validati.patch
deleted file mode 100644
index e0e64e2c..00000000
--- a/recipes-multimedia/gstreamer/gstreamer1.0/0003-tests-seek-Don-t-use-too-strict-timeout-for-validati.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1From 1db36347d05d88835519368442e9aa89c64091ad Mon Sep 17 00:00:00 2001
2From: Seungha Yang <seungha@centricular.com>
3Date: Tue, 15 Sep 2020 00:54:58 +0900
4Subject: [PATCH] tests: seek: Don't use too strict timeout for validation
5
6Expected segment-done message might not be seen within expected
7time if system is not powerful enough.
8
9Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/625>
10
11Upstream-Status: Backport [https://cgit.freedesktop.org/gstreamer/gstreamer/commit?id=f44312ae5d831438fcf8041162079c65321c588c]
12Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
13---
14 tests/check/pipelines/seek.c | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/tests/check/pipelines/seek.c b/tests/check/pipelines/seek.c
18index 28bb8846d..5f7447bc5 100644
19--- a/tests/check/pipelines/seek.c
20+++ b/tests/check/pipelines/seek.c
21@@ -521,7 +521,7 @@ GST_START_TEST (test_loopback_2)
22
23 GST_INFO ("wait for segment done message");
24
25- msg = gst_bus_timed_pop_filtered (bus, (GstClockTime) 2 * GST_SECOND,
26+ msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
27 GST_MESSAGE_SEGMENT_DONE | GST_MESSAGE_ERROR);
28 fail_unless (msg, "no message within the timed window");
29 fail_unless_equals_string (GST_MESSAGE_TYPE_NAME (msg), "segment-done");
30--
312.29.2
32
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0/0006-tests-use-a-dictionaries-for-environment.patch b/recipes-multimedia/gstreamer/gstreamer1.0/0003-tests-use-a-dictionaries-for-environment.patch
index 46813cec..10a6dcc6 100644
--- a/recipes-multimedia/gstreamer/gstreamer1.0/0006-tests-use-a-dictionaries-for-environment.patch
+++ b/recipes-multimedia/gstreamer/gstreamer1.0/0003-tests-use-a-dictionaries-for-environment.patch
@@ -1,4 +1,4 @@
1From e82dedec1803922656e92285fc1bb75b2cdc0aad Mon Sep 17 00:00:00 2001 1From fe830f0f75f3b4b41e3dbef8d4cf6ee4103c9e06 Mon Sep 17 00:00:00 2001
2From: Jose Quaresma <quaresma.jose@gmail.com> 2From: Jose Quaresma <quaresma.jose@gmail.com>
3Date: Sat, 24 Apr 2021 10:34:47 +0100 3Date: Sat, 24 Apr 2021 10:34:47 +0100
4Subject: [PATCH 3/4] tests: use a dictionaries for environment 4Subject: [PATCH 3/4] tests: use a dictionaries for environment
@@ -10,29 +10,31 @@ Upstream-Status: Submitted [https://gitlab.freedesktop.org/gstreamer/gstreamer/-
10 10
11Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> 11Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
12--- 12---
13 tests/check/meson.build | 19 +++++++++++-------- 13 subprojects/gstreamer/tests/check/meson.build | 21 ++++++++++++-------
14 1 file changed, 11 insertions(+), 8 deletions(-) 14 1 file changed, 13 insertions(+), 8 deletions(-)
15 15
16diff --git a/tests/check/meson.build b/tests/check/meson.build 16diff --git a/subprojects/gstreamer/tests/check/meson.build b/subprojects/gstreamer/tests/check/meson.build
17index a697a7b06..f64524904 100644 17index 00a138a568..48ec2532f8 100644
18--- a/tests/check/meson.build 18--- a/subprojects/gstreamer/tests/check/meson.build
19+++ b/tests/check/meson.build 19+++ b/subprojects/gstreamer/tests/check/meson.build
20@@ -161,14 +161,17 @@ foreach t : core_tests 20@@ -161,14 +161,19 @@ foreach t : core_tests
21 install: installed_tests_enabled, 21 install: installed_tests_enabled,
22 ) 22 )
23 23
24- env = environment() 24- env = environment()
25- env.set('GST_PLUGIN_PATH_1_0', meson.build_root()) 25- env.set('GST_PLUGIN_PATH_1_0', meson.project_build_root())
26- env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '') 26- env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
27- env.set('GST_STATE_IGNORE_ELEMENTS', '') 27- env.set('GST_STATE_IGNORE_ELEMENTS', '')
28- env.set('CK_DEFAULT_TIMEOUT', '20') 28- env.set('CK_DEFAULT_TIMEOUT', '20')
29- env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name)) 29- env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name))
30- env.set('GST_PLUGIN_SCANNER_1_0', gst_scanner_dir + '/gst-plugin-scanner') 30- env.set('GST_PLUGIN_SCANNER_1_0', gst_scanner_dir + '/gst-plugin-scanner')
31- env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer') 31- env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer')
32+ # environment() can't be passed to configure_file and it is needed for installed_tests 32+ # meson environment object can't be passed to configure_file and
33+ # use a dictionary as this is simplest solution to install the environment 33+ # installed tests uses configure_file to install the environment.
34+ # use a dictionary as this is the simplest solution
35+ # to install the environment.
34+ env = { 36+ env = {
35+ 'GST_PLUGIN_PATH_1_0': meson.build_root(), 37+ 'GST_PLUGIN_PATH_1_0': meson.project_build_root(),
36+ 'GST_PLUGIN_SYSTEM_PATH_1_0': '', 38+ 'GST_PLUGIN_SYSTEM_PATH_1_0': '',
37+ 'GST_STATE_IGNORE_ELEMENTS': '', 39+ 'GST_STATE_IGNORE_ELEMENTS': '',
38+ 'CK_DEFAULT_TIMEOUT': '20', 40+ 'CK_DEFAULT_TIMEOUT': '20',
@@ -44,5 +46,5 @@ index a697a7b06..f64524904 100644
44 if installed_tests_enabled 46 if installed_tests_enabled
45 test_conf = configuration_data() 47 test_conf = configuration_data()
46-- 48--
472.31.1 492.33.1
48 50
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0/0004-tests-add-helper-script-to-run-the-installed_tests.patch b/recipes-multimedia/gstreamer/gstreamer1.0/0004-tests-add-helper-script-to-run-the-installed_tests.patch
new file mode 100644
index 00000000..efa004f8
--- /dev/null
+++ b/recipes-multimedia/gstreamer/gstreamer1.0/0004-tests-add-helper-script-to-run-the-installed_tests.patch
@@ -0,0 +1,74 @@
1From 4dcbabebca2ad6f1fdd59ee35a858082e87db7b6 Mon Sep 17 00:00:00 2001
2From: Jose Quaresma <quaresma.jose@gmail.com>
3Date: Sun, 2 May 2021 01:58:01 +0100
4Subject: [PATCH 4/4] tests: add helper script to run the installed_tests
5
6- this is a bash script that will run the installed_tests
7with some of the environment variables used in the meson
8testing framework.
9
10Upstream-Status: Submitted [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/789]
11
12Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
13---
14 subprojects/gstreamer/tests/check/meson.build | 17 +++++++++++++++++
15 .../gstreamer/tests/check/template.sh.in | 9 +++++++++
16 .../gstreamer/tests/check/template.test.in | 2 +-
17 3 files changed, 27 insertions(+), 1 deletion(-)
18 create mode 100755 subprojects/gstreamer/tests/check/template.sh.in
19
20diff --git a/subprojects/gstreamer/tests/check/meson.build b/subprojects/gstreamer/tests/check/meson.build
21index 48ec2532f8..7dc4990d4e 100644
22--- a/subprojects/gstreamer/tests/check/meson.build
23+++ b/subprojects/gstreamer/tests/check/meson.build
24@@ -185,6 +185,23 @@ foreach t : core_tests
25 install_dir: installed_tests_metadir,
26 configuration: test_conf
27 )
28+
29+ # All the tests will be deployed on the target machine and
30+ # we use the home folder ~ for the registry which will then expand at runtime.
31+ # Using the /tmp/gstreamer-1.0/@0@.registry can be problematic as it mostly
32+ # is mounted using tmpfs and if the machine crash from some reason we can lost the registry
33+ # that is useful for debug propose of the tests itself.
34+ env += {'GST_REGISTRY': '~/.cache/gstreamer-1.0/@0@.registry'.format(test_name)}
35+
36+ # Set the full path for the test it self.
37+ env += {'TEST': '@0@/@1@'.format(join_paths(prefix, installed_tests_execdir), test_name)}
38+
39+ configure_file(
40+ input : 'template.sh.in',
41+ output: test_name + '.sh',
42+ install_dir: installed_tests_execdir,
43+ configuration : env,
44+ )
45 endif
46
47 test(test_name, exe, env: env, timeout : 3 * 60)
48diff --git a/subprojects/gstreamer/tests/check/template.sh.in b/subprojects/gstreamer/tests/check/template.sh.in
49new file mode 100755
50index 0000000000..cf7d31b0ea
51--- /dev/null
52+++ b/subprojects/gstreamer/tests/check/template.sh.in
53@@ -0,0 +1,9 @@
54+#!/bin/sh
55+
56+set -ax
57+
58+CK_DEFAULT_TIMEOUT="@CK_DEFAULT_TIMEOUT@"
59+GST_PLUGIN_LOADING_WHITELIST="@GST_PLUGIN_LOADING_WHITELIST@"
60+GST_REGISTRY=@GST_REGISTRY@
61+GST_STATE_IGNORE_ELEMENTS="@GST_STATE_IGNORE_ELEMENTS@"
62+exec @TEST@
63diff --git a/subprojects/gstreamer/tests/check/template.test.in b/subprojects/gstreamer/tests/check/template.test.in
64index f701627f87..b74ef6ad73 100644
65--- a/subprojects/gstreamer/tests/check/template.test.in
66+++ b/subprojects/gstreamer/tests/check/template.test.in
67@@ -1,3 +1,3 @@
68 [Test]
69 Type=session
70-Exec=@installed_tests_dir@/@program@
71+Exec=@installed_tests_dir@/@program@.sh
72--
732.33.1
74
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0/0005-tests-remove-gstbin-test_watch_for_state_change-test.patch b/recipes-multimedia/gstreamer/gstreamer1.0/0005-tests-remove-gstbin-test_watch_for_state_change-test.patch
new file mode 100644
index 00000000..f51df6d2
--- /dev/null
+++ b/recipes-multimedia/gstreamer/gstreamer1.0/0005-tests-remove-gstbin-test_watch_for_state_change-test.patch
@@ -0,0 +1,107 @@
1From b935abba3d8fa3ea1ce384c08e650afd8c20b78a Mon Sep 17 00:00:00 2001
2From: Claudius Heine <ch@denx.de>
3Date: Wed, 2 Feb 2022 13:47:02 +0100
4Subject: [PATCH] tests: remove gstbin:test_watch_for_state_change testcase
5
6This testcase seems to be flaky, and upstream marked it as such:
7https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/778
8
9This patch removes the testcase to avoid it interfering with out ptest.
10
11Signed-off-by: Claudius Heine <ch@denx.de>
12
13Upstream-Status: Inappropriate [needs proper upstream fix]
14---
15 tests/check/gst/gstbin.c | 69 -------------------
16 1 file changed, 69 deletions(-)
17
18diff --git a/tests/check/gst/gstbin.c b/tests/check/gst/gstbin.c
19index e366d5fe20..ac29d81474 100644
20--- a/tests/check/gst/gstbin.c
21+++ b/tests/check/gst/gstbin.c
22@@ -691,74 +691,6 @@ GST_START_TEST (test_message_state_changed_children)
23
24 GST_END_TEST;
25
26-GST_START_TEST (test_watch_for_state_change)
27-{
28- GstElement *src, *sink, *bin;
29- GstBus *bus;
30- GstStateChangeReturn ret;
31-
32- bin = gst_element_factory_make ("bin", NULL);
33- fail_unless (bin != NULL, "Could not create bin");
34-
35- bus = g_object_new (gst_bus_get_type (), NULL);
36- gst_object_ref_sink (bus);
37- gst_element_set_bus (GST_ELEMENT_CAST (bin), bus);
38-
39- src = gst_element_factory_make ("fakesrc", NULL);
40- fail_if (src == NULL, "Could not create fakesrc");
41- sink = gst_element_factory_make ("fakesink", NULL);
42- fail_if (sink == NULL, "Could not create fakesink");
43-
44- gst_bin_add (GST_BIN (bin), sink);
45- gst_bin_add (GST_BIN (bin), src);
46-
47- fail_unless (gst_element_link (src, sink), "could not link src and sink");
48-
49- /* change state, spawning two times three messages */
50- ret = gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PAUSED);
51- fail_unless (ret == GST_STATE_CHANGE_ASYNC);
52- ret =
53- gst_element_get_state (GST_ELEMENT (bin), NULL, NULL,
54- GST_CLOCK_TIME_NONE);
55- fail_unless (ret == GST_STATE_CHANGE_SUCCESS);
56-
57- pop_state_changed (bus, 6);
58- pop_async_done (bus);
59- pop_latency (bus);
60-
61- fail_unless (gst_bus_have_pending (bus) == FALSE,
62- "Unexpected messages on bus");
63-
64- ret = gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PLAYING);
65- fail_unless (ret == GST_STATE_CHANGE_SUCCESS);
66-
67- pop_state_changed (bus, 3);
68-
69- /* this one might return either SUCCESS or ASYNC, likely SUCCESS */
70- ret = gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PAUSED);
71- gst_element_get_state (GST_ELEMENT (bin), NULL, NULL, GST_CLOCK_TIME_NONE);
72-
73- pop_state_changed (bus, 3);
74- if (ret == GST_STATE_CHANGE_ASYNC) {
75- pop_async_done (bus);
76- pop_latency (bus);
77- }
78-
79- fail_unless (gst_bus_have_pending (bus) == FALSE,
80- "Unexpected messages on bus");
81-
82- gst_bus_set_flushing (bus, TRUE);
83-
84- ret = gst_element_set_state (GST_ELEMENT (bin), GST_STATE_NULL);
85- fail_unless (ret == GST_STATE_CHANGE_SUCCESS);
86-
87- /* clean up */
88- gst_object_unref (bus);
89- gst_object_unref (bin);
90-}
91-
92-GST_END_TEST;
93-
94 GST_START_TEST (test_state_change_error_message)
95 {
96 GstElement *src, *sink, *bin;
97@@ -1956,7 +1888,6 @@ gst_bin_suite (void)
98 tcase_add_test (tc_chain, test_message_state_changed);
99 tcase_add_test (tc_chain, test_message_state_changed_child);
100 tcase_add_test (tc_chain, test_message_state_changed_children);
101- tcase_add_test (tc_chain, test_watch_for_state_change);
102 tcase_add_test (tc_chain, test_state_change_error_message);
103 tcase_add_test (tc_chain, test_add_linked);
104 tcase_add_test (tc_chain, test_add_self);
105--
1062.33.1
107
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0/0007-tests-install-the-environment-for-installed_tests.patch b/recipes-multimedia/gstreamer/gstreamer1.0/0007-tests-install-the-environment-for-installed_tests.patch
deleted file mode 100644
index eabe7bcb..00000000
--- a/recipes-multimedia/gstreamer/gstreamer1.0/0007-tests-install-the-environment-for-installed_tests.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From 57d2965e979f886e03eecd7e351bf01812053971 Mon Sep 17 00:00:00 2001
2From: Jose Quaresma <quaresma.jose@gmail.com>
3Date: Sun, 2 May 2021 01:58:01 +0100
4Subject: [PATCH 4/4] tests: install the environment for installed_tests
5
6- adapt the test environment for installed_tests
7- install the test environment for installed_tests
8- run the tests using the installed environment
9
10Upstream-Status: Submitted [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/789]
11
12Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
13---
14 template.test.in | 2 +-
15 tests/check/meson.build | 18 ++++++++++++++++++
16 2 files changed, 19 insertions(+), 1 deletion(-)
17
18diff --git a/template.test.in b/template.test.in
19index f701627f8..9a3fbdd09 100644
20--- a/template.test.in
21+++ b/template.test.in
22@@ -1,3 +1,3 @@
23 [Test]
24 Type=session
25-Exec=@installed_tests_dir@/@program@
26+Exec=sh -c 'set -aex && source @installed_tests_dir@/@program@.env && exec @installed_tests_dir@/@program@'
27diff --git a/tests/check/meson.build b/tests/check/meson.build
28index f64524904..a67e0f8dd 100644
29--- a/tests/check/meson.build
30+++ b/tests/check/meson.build
31@@ -183,6 +183,24 @@ foreach t : core_tests
32 install_dir: installed_tests_metadir,
33 configuration: test_conf
34 )
35+
36+ env += {'GST_REGISTRY': '~/.cache/gstreamer-1.0/@0@.registry'.format(test_name)}
37+ configure_file(
38+ output: test_name + '.env',
39+ install_dir: installed_tests_execdir,
40+ configuration : env,
41+ )
42+ # helper to convert a meson environment dictionay object exported with configure_file
43+ # this also remove not needed variables for the installed tests
44+ meson.add_postconf_script('sed', '-i',
45+ '-e', '/^#define/!d',
46+ '-e', 's/^#define //g',
47+ '-e', '/^GST_PLUGIN_PATH_1_0/d',
48+ '-e', '/^GST_PLUGIN_SYSTEM_PATH_1_0/d',
49+ '-e', '/^GST_PLUGIN_SCANNER_1_0/d',
50+ '-e', 's/ /=/',
51+ join_paths(meson.current_build_dir(), test_name + '.env')
52+ )
53 endif
54
55 test(test_name, exe, env: env, timeout : 3 * 60)
56--
572.31.1
58