[glib-networking] Ensure tests run against the GIO modules in the build root
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking] Ensure tests run against the GIO modules in the build root
- Date: Sat, 21 Oct 2017 19:56:50 +0000 (UTC)
commit 04d4bf3f546706228b53b6574bddecd5ef033186
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Sat Oct 21 14:52:32 2017 -0500
Ensure tests run against the GIO modules in the build root
Currently, our tests run against the GIO modules that are installed on
the system. So if we 'ninja test' before running 'ninja install', we'll
be testing the wrong code. And this is actually the default case when
running 'jhbuild buildone -n --check', so that's bad.
This was actually broken in the Autotools build, too. We just never
noticed before. I discovered this after testing a build without TLS
support: after reenabling TLS support and rebuilding glib-networking,
but before installing it, all the TLS tests failed.
https://bugzilla.gnome.org/show_bug.cgi?id=789171
meson.build | 2 +-
proxy/gnome/meson.build | 2 +-
proxy/libproxy/meson.build | 2 +-
proxy/tests/meson.build | 13 +++++++------
tls/tests/meson.build | 3 ++-
5 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/meson.build b/meson.build
index fd582cf..a90065d 100644
--- a/meson.build
+++ b/meson.build
@@ -102,7 +102,7 @@ enable_installed_tests = get_option('installed_tests')
test_template = files('template.test.in')
if enable_libproxy_support or enable_gnome_proxy_support
- test_programs = []
+ proxy_test_programs = []
if enable_libproxy_support
subdir('proxy/libproxy')
diff --git a/proxy/gnome/meson.build b/proxy/gnome/meson.build
index d6fbf1a..45f210d 100644
--- a/proxy/gnome/meson.build
+++ b/proxy/gnome/meson.build
@@ -20,4 +20,4 @@ shared_module(
install_dir: gio_module_dir
)
-test_programs += [['gnome', deps]]
+proxy_test_programs += [['gnome', deps]]
diff --git a/proxy/libproxy/meson.build b/proxy/libproxy/meson.build
index ca5a84e..0db801a 100644
--- a/proxy/libproxy/meson.build
+++ b/proxy/libproxy/meson.build
@@ -59,4 +59,4 @@ executable(
install_dir: libexecdir
)
-test_programs += [['libproxy', deps]]
+proxy_test_programs += [['libproxy', deps]]
diff --git a/proxy/tests/meson.build b/proxy/tests/meson.build
index d7a5aba..68f9ac7 100644
--- a/proxy/tests/meson.build
+++ b/proxy/tests/meson.build
@@ -3,12 +3,7 @@ cflags = [
'-DTOP_BUILDDIR="@0@"'.format(meson.build_root())
]
-envs = [
- 'G_TEST_SRCDIR=' + meson.current_source_dir(),
- 'G_TEST_BUILDDIR=' + meson.current_build_dir()
-]
-
-foreach program: test_programs
+foreach program: proxy_test_programs
test_conf = configuration_data()
test_conf.set('installed_tests_dir', installed_tests_execdir)
test_conf.set('program', program[0])
@@ -31,6 +26,12 @@ foreach program: test_programs
install_dir: installed_tests_execdir
)
+ envs = [
+ 'G_TEST_SRCDIR=' + meson.current_source_dir(),
+ 'G_TEST_BUILDDIR=' + meson.current_build_dir(),
+ 'GIO_MODULE_DIR=' + join_paths(meson.build_root(), 'proxy', program[0])
+ ]
+
test(
program[0],
exe,
diff --git a/tls/tests/meson.build b/tls/tests/meson.build
index 05f8033..a8eef3b 100644
--- a/tls/tests/meson.build
+++ b/tls/tests/meson.build
@@ -13,7 +13,8 @@ cflags = [
envs = [
'G_TEST_SRCDIR=' + meson.current_source_dir(),
- 'G_TEST_BUILDDIR=' + meson.current_build_dir()
+ 'G_TEST_BUILDDIR=' + meson.current_build_dir(),
+ 'GIO_MODULE_DIR=' + join_paths(meson.build_root(), 'tls', 'gnutls')
]
test_programs = [
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]