[dconf: 5/8] tests: Set G_DEBUG and other useful environment variables



commit 0b74acedb5fcf3621c33da014cf944047499b9cf
Author: Philip Withnall <withnall endlessm com>
Date:   Thu Aug 9 17:45:40 2018 +0100

    tests: Set G_DEBUG and other useful environment variables
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 gsettings/meson.build | 8 +++++++-
 meson.build           | 6 ++++++
 tests/meson.build     | 7 ++++++-
 3 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/gsettings/meson.build b/gsettings/meson.build
index 5319cce..a1d0207 100644
--- a/gsettings/meson.build
+++ b/gsettings/meson.build
@@ -19,10 +19,16 @@ libdconf_settings = shared_library(
   install_dir: join_paths(dconf_libdir, 'gio', 'modules')
 )
 
+envs = test_env + [
+  'G_TEST_SRCDIR=' + meson.current_source_dir(),
+  'G_TEST_BUILDDIR=' + meson.current_build_dir(),
+  'GSETTINGS_LIB=' + libdconf_settings.full_path(),
+]
+
 unit_test = 'abicheck'
 
 test(
   unit_test,
   find_program(unit_test + '.sh'),
-  env: 'GSETTINGS_LIB=' + libdconf_settings.full_path()
+  env: envs,
 )
diff --git a/meson.build b/meson.build
index af4699a..7f9767e 100644
--- a/meson.build
+++ b/meson.build
@@ -91,6 +91,12 @@ configure_file(
   configuration: config_h
 )
 
+test_env = [
+  'G_DEBUG=gc-friendly,fatal-warnings',
+  'MALLOC_CHECK_=2',
+  'LC_ALL=C.UTF-8',
+]
+
 gnome = import('gnome')
 pkg = import('pkgconfig')
 
diff --git a/tests/meson.build b/tests/meson.build
index 6737a97..0ec6cbe 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -10,6 +10,11 @@ libdconf_mock = static_library(
   dependencies: glib_dep
 )
 
+envs = test_env + [
+  'G_TEST_SRCDIR=' + meson.current_source_dir(),
+  'G_TEST_BUILDDIR=' + meson.current_build_dir(),
+]
+
 test_dir = meson.current_source_dir()
 
 dl_dep = cc.find_library('dl', required: false)
@@ -36,5 +41,5 @@ foreach unit_test: unit_tests
     link_with: unit_test[4]
   )
 
-  test(unit_test[0], exe, is_parallel: false)
+  test(unit_test[0], exe, is_parallel: false, env: envs)
 endforeach


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