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.
This commit is contained in:
parent
a972236bb2
commit
fc880442f5
2 changed files with 94 additions and 15 deletions
|
|
@ -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
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
gtk,
|
||||
libsoup,
|
||||
gio,
|
||||
glib,
|
||||
gmime,
|
||||
webkit2gtk,
|
||||
geary_engine_dep,
|
||||
geary_client_dep,
|
||||
javascriptcoregtk,
|
||||
libunwind,
|
||||
libxml,
|
||||
sqlite,
|
||||
]
|
||||
|
||||
geary_test_bin = executable('geary-test',
|
||||
geary_test_sources,
|
||||
dependencies: geary_test_dependencies,
|
||||
geary_test_client_dependencies = [
|
||||
geary_client_dep,
|
||||
geary_engine_dep,
|
||||
gee,
|
||||
gmime,
|
||||
gtk,
|
||||
libsoup,
|
||||
webkit2gtk,
|
||||
]
|
||||
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue