test: Break out engine mock objects into their own name-space

Engine mocks don't need to be in the `Geary` namespace, and including
them there makes it difficult to use them in client tests, so put them
all in their own name-space and corresponding directory.
This commit is contained in:
Michael Gratton 2020-08-10 16:13:57 +10:00 committed by Michael James Gratton
parent 3e156525ae
commit 2030b2dec7
24 changed files with 436 additions and 414 deletions

View file

@ -1,22 +1,27 @@
subdir('data')
# Mock classes should be compiled into a stand-alone test lib for
# re-use by both client and engine test suites, but we can't since
# that would depend on geary-engine.vapi, and the engine test sute
# needs to depend geary-engine_internal.vapi, which leads to duplicate
# symbols when linking. So just duplicate the sources in both.
libmock_sources = [
'mock/mock-account.vala',
'mock/mock-contact-store.vala',
'mock/mock-client-service.vala',
'mock/mock-credentials-mediator.vala',
'mock/mock-email-identifier.vala',
'mock/mock-email-properties.vala',
'mock/mock-folder.vala',
'mock/mock-folder-properties.vala',
'mock/mock-search-query.vala',
]
geary_test_engine_sources = [
'test-case.vala',
'test-server.vala',
'test-engine.vala',
# These should be included in the test lib sources, but we can't
# since that would make the test lib depend on geary-engine.vapi,
# and the engine test sute needs to depend
# geary-engine_internal.vapi, which leads to duplicate symbols when
# linking
'engine/api/geary-account-mock.vala',
'engine/api/geary-contact-store-mock.vala',
'engine/api/geary-credentials-mediator-mock.vala',
'engine/api/geary-email-identifier-mock.vala',
'engine/api/geary-email-properties-mock.vala',
'engine/api/geary-folder-mock.vala',
'engine/api/geary-folder-properties-mock.vala',
'engine/common/common-contact-harvester-mock.vala',
'engine/api/geary-account-information-test.vala',
@ -72,14 +77,6 @@ geary_test_client_sources = [
'test-case.vala',
'test-client.vala',
# These should be included in the test lib sources, but we can't
# since that would make the test lib depend on geary-engine.vapi,
# and the engine test sute needs to depend
# geary-engine_internal.vapi, which leads to duplicate symbols when
# linking
'engine/api/geary-email-identifier-mock.vala',
'engine/api/geary-credentials-mediator-mock.vala',
'client/accounts/accounts-manager-test.vala',
'client/application/application-client-test.vala',
'client/application/application-configuration-test.vala',
@ -126,7 +123,7 @@ if get_option('tnef-support')
endif
geary_test_engine_bin = executable('test-engine',
geary_test_engine_sources,
geary_test_engine_sources + libmock_sources,
dependencies: geary_test_engine_dependencies,
include_directories: config_h_dir,
vala_args: geary_test_engine_vala_args,
@ -142,7 +139,7 @@ geary_test_client_dependencies = [
geary_test_client_dependencies += geary_client_dependencies
geary_test_client_bin = executable('test-client',
geary_test_client_sources,
geary_test_client_sources + libmock_sources,
dependencies: geary_test_client_dependencies,
include_directories: config_h_dir,
vala_args: geary_vala_args,