[geary] Update Meson build to also build separate engine and client tests.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary] Update Meson build to also build separate engine and client tests.
- Date: Mon, 18 Dec 2017 03:50:06 +0000 (UTC)
commit fc880442f577a599995b68365a4e25e6bb5961d0
Author: Michael James Gratton <mike vee net>
Date: Fri Dec 15 15:11:24 2017 +1100
Update Meson build to also build separate engine and client tests.
* src/engine/meson.build: Add some ugly hacks to both build the internal
VAPI and work around a valac bug to ensure the internal VAPI correctly
references the internal header, not the public header.
* test/meson.build: Split the test suite build into test-engine and
test-client.
src/engine/meson.build | 48 +++++++++++++++++++++++++++++++++++++++-
test/meson.build | 57 +++++++++++++++++++++++++++++++++++++----------
2 files changed, 92 insertions(+), 13 deletions(-)
---
diff --git a/src/engine/meson.build b/src/engine/meson.build
index 89431ea..a1c43fc 100644
--- a/src/engine/meson.build
+++ b/src/engine/meson.build
@@ -331,12 +331,27 @@ geary_engine_dependencies = [
sqlite
]
+geary_engine_vala_options = geary_vala_options
+geary_engine_vala_options += [
+ # Nasty hack to make sure engine internal VAPI is generated. See
+ # Meson issue https://github.com/mesonbuild/meson/issues/1781 for
+ # official internal VAPI support. See Vala Bug 731322 about the
+ # specifics of the arguments used below to generate the internal
+ # VAPI. In paricular, the filenames needs to not contain any paths
+ # or else the internal vapi will use the public header, not the
+ # internal header. Of course these paths breaks the build, so we fix
+ # it up using cp below.
+ '--header=geary-engine.h',
+ '--internal-vapi=geary-engine-internal.vapi',
+ '--internal-header=geary-engine-internal.h'
+]
+
geary_engine_lib = static_library('geary-engine',
geary_engine_sources,
dependencies: geary_engine_dependencies,
link_with: sqlite3_unicodesn_lib,
include_directories: config_h_dir,
- vala_args: geary_vala_options,
+ vala_args: geary_engine_vala_options,
c_args: geary_c_options,
)
@@ -347,3 +362,34 @@ geary_engine_dep = declare_dependency(
],
include_directories: include_directories('.'),
)
+
+# Dummy target to fix the location of the public and internal headers,
+# and tell Meson about the internal VAPI
+geary_engine_internal_vapi = custom_target(
+ 'geary-engine-internal-vapi',
+ output: ['geary-engine-internal.vapi'],
+ command: [
+ find_program('cp'),
+ 'geary-engine.h',
+ 'geary-engine-internal.h',
+ '@OUTDIR@/geary-engine@sta/geary-engine-internal.vapi',
+ '@OUTDIR@',
+ ],
+ depends: geary_engine_lib
+)
+
+geary_engine_internal_dep = declare_dependency(
+ # Can't just include geary_engine_lib in link_with since that will
+ # pull in the public header and we get duplicate symbol errors.
+ link_args: [
+ '-L' + meson.build_root() + '/src/engine',
+ '-lgeary-engine'
+ ],
+ link_with: [
+ sqlite3_unicodesn_lib,
+ ],
+ include_directories: include_directories('.'),
+ sources: [
+ geary_engine_internal_vapi
+ ],
+)
diff --git a/test/meson.build b/test/meson.build
index a4e77d8..43affd7 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -1,9 +1,14 @@
-geary_test_sources = [
- 'main.vala',
- 'testcase.vala', # Based on same file in libgee, courtesy Julien Peeters
+geary_test_engine_sources = [
+ 'test-engine.vala',
+ 'testcase.vala',
'engine/api/geary-attachment-test.vala',
'engine/api/geary-engine-test.vala',
+ 'engine/api/geary-email-identifier-test.vala',
+ 'engine/api/geary-folder-test.vala',
+ 'engine/api/geary-folder-path-test.vala',
+ 'engine/app/app-conversation-test.vala',
+ 'engine/app/app-conversation-set-test.vala',
'engine/imap/command/imap-create-command-test.vala',
'engine/imap/response/imap-namespace-response-test.vala',
'engine/imap/transport/imap-deserializer-test.vala',
@@ -16,7 +21,12 @@ geary_test_sources = [
'engine/util-idle-manager-test.vala',
'engine/util-inet-test.vala',
'engine/util-js-test.vala',
- 'engine/util-timeout-manager-test.vala',
+ 'engine/util-timeout-manager-test.vala'
+]
+
+geary_test_client_sources = [
+ 'test-client.vala',
+ 'testcase.vala',
'client/application/geary-configuration-test.vala',
'client/components/client-web-view-test.vala',
@@ -26,25 +36,48 @@ geary_test_sources = [
'js/client-page-state-test.vala',
'js/composer-page-state-test.vala',
'js/conversation-page-state-test.vala',
+
geary_compiled_schema,
geary_resources
]
-geary_test_dependencies = [
+geary_test_engine_dependencies = [
+ geary_engine_internal_dep,
+ gee,
+ gio,
+ glib,
+ gmime,
+ javascriptcoregtk,
+ libunwind,
+ libxml,
+ sqlite,
+]
+
+geary_test_client_dependencies = [
+ geary_client_dep,
+ geary_engine_dep,
gee,
+ gmime,
gtk,
libsoup,
- gmime,
webkit2gtk,
- geary_engine_dep,
- geary_client_dep,
]
-geary_test_bin = executable('geary-test',
- geary_test_sources,
- dependencies: geary_test_dependencies,
+geary_test_engine_bin = executable('geary-test-engine',
+ geary_test_engine_sources,
+ dependencies: geary_test_engine_dependencies,
include_directories: config_h_dir,
vala_args: geary_vala_options,
c_args: geary_c_options,
)
-test('Geary test suite', geary_test_bin)
+
+geary_test_client_bin = executable('geary-test-client',
+ geary_test_client_sources,
+ dependencies: geary_test_client_dependencies,
+ include_directories: config_h_dir,
+ vala_args: geary_vala_options,
+ c_args: geary_c_options,
+)
+
+test('engine-tests', geary_test_engine_bin)
+test('client-tests', geary_test_client_bin)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]