[glib/wip/smcv/deprecated-prop-followup: 39/41] Move common test environment variables to top level




commit 8d9ff4f9409e4bccc30b75f7149a630b79eee13a
Author: Simon McVittie <smcv collabora com>
Date:   Tue Sep 13 11:35:34 2022 +0100

    Move common test environment variables to top level
    
    Signed-off-by: Simon McVittie <smcv collabora com>

 gio/tests/meson.build                 | 2 +-
 glib/tests/meson.build                | 4 +---
 gmodule/tests/meson.build             | 4 +---
 gobject/tests/meson.build             | 5 +----
 gobject/tests/performance/meson.build | 5 +----
 meson.build                           | 4 ++++
 6 files changed, 9 insertions(+), 15 deletions(-)
---
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index c3e4e4cb33..14a765fd04 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -144,7 +144,7 @@ python_tests = [
   'codegen.py',
 ]
 
-test_env = environment()
+test_env = environment(common_test_env)
 test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
 test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
 test_env.set('GIO_MODULE_DIR', '')
diff --git a/glib/tests/meson.build b/glib/tests/meson.build
index d746178233..eafb5743f9 100644
--- a/glib/tests/meson.build
+++ b/glib/tests/meson.build
@@ -236,11 +236,9 @@ if installed_tests_enabled
   install_subdir('time-zones', install_dir : installed_tests_execdir)
 endif
 
-test_env = environment()
+test_env = environment(common_test_env)
 test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
 test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
-test_env.set('G_DEBUG', 'gc-friendly')
-test_env.set('MALLOC_CHECK_', '2')
 
 test_deps = [libm, thread_dep, libglib_dep]
 test_cargs = ['-DG_LOG_DOMAIN="GLib"', '-UG_DISABLE_ASSERT']
diff --git a/gmodule/tests/meson.build b/gmodule/tests/meson.build
index cc8125eda4..3de10ef746 100644
--- a/gmodule/tests/meson.build
+++ b/gmodule/tests/meson.build
@@ -41,11 +41,9 @@ foreach module : ['moduletestplugin_a', 'moduletestplugin_b']
   )
 endforeach
 
-test_env = environment()
+test_env = environment(common_test_env)
 test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
 test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
-test_env.set('G_DEBUG', 'gc-friendly')
-test_env.set('MALLOC_CHECK_', '2')
 
 test_deps = [libm, thread_dep, libglib_dep, libgmodule_dep]
 test_cargs = ['-DG_LOG_DOMAIN="GModule"', '-UG_DISABLE_ASSERT']
diff --git a/gobject/tests/meson.build b/gobject/tests/meson.build
index c3fc29f6b5..4ee3310d3b 100644
--- a/gobject/tests/meson.build
+++ b/gobject/tests/meson.build
@@ -117,12 +117,9 @@ python_tests = [
   'mkenums.py',
 ]
 
-# FIXME: put common bits of test environment() in one location
-test_env = environment()
+test_env = environment(common_test_env)
 test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
 test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
-test_env.set('G_DEBUG', 'gc-friendly')
-test_env.set('MALLOC_CHECK_', '2')
 
 test_deps = [libm, thread_dep, libglib_dep, libgobject_dep]
 test_cargs = ['-DG_LOG_DOMAIN="GLib-GObject"', '-UG_DISABLE_ASSERT']
diff --git a/gobject/tests/performance/meson.build b/gobject/tests/performance/meson.build
index 22bf79da0a..e1665579cf 100644
--- a/gobject/tests/performance/meson.build
+++ b/gobject/tests/performance/meson.build
@@ -3,12 +3,9 @@ gobject_tests = {
   'performance-threaded' : { 'args' : [ '--seconds', '0' ] },
 }
 
-# FIXME: put common bits of test environment() in one location
-test_env = environment()
+test_env = environment(common_test_env)
 test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
 test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
-test_env.set('G_DEBUG', 'gc-friendly')
-test_env.set('MALLOC_CHECK_', '2')
 
 test_deps = [libm, thread_dep, libglib_dep, libgobject_dep]
 test_cargs = ['-DG_LOG_DOMAIN="GLib-GObject"', '-UG_DISABLE_ASSERT']
diff --git a/meson.build b/meson.build
index 4885de9947..68c8a63b9c 100644
--- a/meson.build
+++ b/meson.build
@@ -2371,6 +2371,10 @@ if want_systemtap and enable_dtrace
   enable_systemtap = true
 endif
 
+common_test_env = [
+  'G_DEBUG=gc-friendly',
+  'MALLOC_CHECK_=2',
+]
 test_timeout = 60
 test_timeout_slow = 180
 


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