[gexiv2/wip/lantw/use-sh-and-respect-env-var: 3/3] test: Respect environment variables set by users



commit 2fd966fd9ffa253a4f1f1cb6d5e2a01065c24773
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Tue Jul 9 01:04:16 2019 +0800

    test: Respect environment variables set by users
    
    Instead of ignoring its existing value, we should use 'prepend'
    method to add our path into a list of paths. This is especially
    important in JHBuild environment because libraries and programs
    installed in JHBuild prefix may rely on environment variables to work.

 test/meson.build | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/test/meson.build b/test/meson.build
index c95e429..30edde3 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -1,12 +1,12 @@
 test_sample_path = join_paths(meson.current_source_dir(), 'data')
 python_module_path = join_paths(meson.current_source_dir(), 'python')
 
-test_env = ['G_SLICE=always-malloc',
-            'GI_TYPELIB_PATH=@0@'.format(typelib_path),
-            'PYTHONPATH=@0@'.format(python_module_path),
-            'TEST_DATA_DIR=@0@'.format(test_sample_path),
-            'LD_LIBRARY_PATH=@0@'.format(typelib_path),
-            ]
+test_env = environment()
+test_env.set('G_SLICE', 'always-malloc')
+test_env.set('TEST_DATA_DIR', test_sample_path)
+test_env.prepend('GI_TYPELIB_PATH', typelib_path)
+test_env.prepend('LD_LIBRARY_PATH', typelib_path)
+test_env.prepend('PYTHONPATH', python_module_path)
 
 regression_test = executable('gexiv2-regression', 'gexiv2-regression.c',
                              dependencies : [gobject, gio],


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]