summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2018-08-09 17:45:40 +0100
committerPhilip Withnall <withnall@endlessm.com>2018-08-10 14:25:12 +0100
commit0b74acedb5fcf3621c33da014cf944047499b9cf (patch)
tree89220c33e63ce4aa3e9ff52474b6dbfdc2fae46f
parent637c54a0195baa1756c338131327e4d593578375 (diff)
downloaddconf-0b74acedb5fcf3621c33da014cf944047499b9cf.tar.gz
tests: Set G_DEBUG and other useful environment variables
Signed-off-by: Philip Withnall <withnall@endlessm.com>
-rw-r--r--gsettings/meson.build8
-rw-r--r--meson.build6
-rw-r--r--tests/meson.build7
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