1*4882a593SmuzhiyunFrom fe830f0f75f3b4b41e3dbef8d4cf6ee4103c9e06 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Jose Quaresma <quaresma.jose@gmail.com>
3*4882a593SmuzhiyunDate: Sat, 24 Apr 2021 10:34:47 +0100
4*4882a593SmuzhiyunSubject: [PATCH 3/4] tests: use a dictionaries for environment
5*4882a593Smuzhiyun
6*4882a593Smuzhiyunmeson environment() can't be passed to configure_file and it is needed for installed_tests,
7*4882a593Smuzhiyunuse a dictionary as this is simplest solution to install the environment.
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunUpstream-Status: Submitted [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/789]
10*4882a593Smuzhiyun
11*4882a593SmuzhiyunSigned-off-by: Jose Quaresma <quaresma.jose@gmail.com>
12*4882a593Smuzhiyun---
13*4882a593Smuzhiyun subprojects/gstreamer/tests/check/meson.build | 21 ++++++++++++-------
14*4882a593Smuzhiyun 1 file changed, 13 insertions(+), 8 deletions(-)
15*4882a593Smuzhiyun
16*4882a593Smuzhiyundiff --git a/subprojects/gstreamer/tests/check/meson.build b/subprojects/gstreamer/tests/check/meson.build
17*4882a593Smuzhiyunindex 00a138a568..48ec2532f8 100644
18*4882a593Smuzhiyun--- a/subprojects/gstreamer/tests/check/meson.build
19*4882a593Smuzhiyun+++ b/subprojects/gstreamer/tests/check/meson.build
20*4882a593Smuzhiyun@@ -161,14 +161,19 @@ foreach t : core_tests
21*4882a593Smuzhiyun       install: installed_tests_enabled,
22*4882a593Smuzhiyun     )
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun-    env = environment()
25*4882a593Smuzhiyun-    env.set('GST_PLUGIN_PATH_1_0', meson.project_build_root())
26*4882a593Smuzhiyun-    env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
27*4882a593Smuzhiyun-    env.set('GST_STATE_IGNORE_ELEMENTS', '')
28*4882a593Smuzhiyun-    env.set('CK_DEFAULT_TIMEOUT', '20')
29*4882a593Smuzhiyun-    env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name))
30*4882a593Smuzhiyun-    env.set('GST_PLUGIN_SCANNER_1_0', gst_scanner_dir + '/gst-plugin-scanner')
31*4882a593Smuzhiyun-    env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer')
32*4882a593Smuzhiyun+    # meson environment object can't be passed to configure_file and
33*4882a593Smuzhiyun+    # installed tests uses configure_file to install the environment.
34*4882a593Smuzhiyun+    # use a dictionary as this is the simplest solution
35*4882a593Smuzhiyun+    # to install the environment.
36*4882a593Smuzhiyun+    env = {
37*4882a593Smuzhiyun+      'GST_PLUGIN_PATH_1_0': meson.project_build_root(),
38*4882a593Smuzhiyun+      'GST_PLUGIN_SYSTEM_PATH_1_0': '',
39*4882a593Smuzhiyun+      'GST_STATE_IGNORE_ELEMENTS': '',
40*4882a593Smuzhiyun+      'CK_DEFAULT_TIMEOUT': '20',
41*4882a593Smuzhiyun+      'GST_REGISTRY': '@0@/@1@.registry'.format(meson.current_build_dir(), test_name),
42*4882a593Smuzhiyun+      'GST_PLUGIN_SCANNER_1_0': gst_scanner_dir + '/gst-plugin-scanner',
43*4882a593Smuzhiyun+      'GST_PLUGIN_LOADING_WHITELIST': 'gstreamer',
44*4882a593Smuzhiyun+    }
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun     if installed_tests_enabled
47*4882a593Smuzhiyun       test_conf = configuration_data()
48*4882a593Smuzhiyun--
49*4882a593Smuzhiyun2.33.1
50*4882a593Smuzhiyun
51