geary/test/meson.build

218 lines
6 KiB
Meson
Raw Normal View History

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',
]
test_engine_sources = [
'test-case.vala',
'test-server.vala',
'test-engine.vala',
'engine/common/common-contact-harvester-mock.vala',
'engine/api/geary-account-information-test.vala',
'engine/api/geary-attachment-test.vala',
'engine/api/geary-composed-email-test.vala',
'engine/api/geary-email-test.vala',
'engine/api/geary-engine-test.vala',
'engine/api/geary-folder-path-test.vala',
'engine/api/geary-service-information-test.vala',
'engine/app/app-conversation-test.vala',
'engine/app/app-conversation-monitor-test.vala',
'engine/app/app-conversation-set-test.vala',
2019-06-09 21:56:25 +10:00
'engine/common/common-contact-store-impl-test.vala',
'engine/common/common-contact-harvester-test.vala',
'engine/common/common-fts-search-query-test.vala',
Make database classes more amenable to asynchronous use. This makes both the open() and open_connection() methods on Geary.DB.Database asynchronous, which allows the VersionedDatabase open_background() and its hackery to be removed, and upgrades to be performed asynchronously as well. It also adds a exec_transaction_async() method to Connection, allowing an existing object to also be used to establish an async transaction. * src/engine/db/db-connection.vala (Connection): Add exec_transaction_async method, update doc comments. * src/engine/db/db-database.vala (Database): Make open and open_connection async by executing SQLite code in a background thread, update call sites. Move job management code out of exec_transaction_async into a new internal add_async_job() method so it can be used by Connection. Add unit tests. * src/engine/db/db-transaction-async-job.vala (TransactionAsyncJob): Add an optional internal connection method and make the job's cancellable an internal property so a Connection instance can specify itself for the transaction. * src/engine/db/db-versioned-database.vala (VersionedDatabase): Remove open_background() hack since open() is now async. Make version upgrade hooks for derived classes async and update call sites. Use a Nonblocking.Mutex rather than GLib mutex so upgrade exclusion works asynchronously. Add unit tests. * src/engine/imap-db/imap-db-database.vala (Database): Make database upgrade methods async and execute SQL in async instructions now that the bases classes support it. Add unit tests.
2018-05-08 09:18:06 +09:30
'engine/db/db-database-test.vala',
'engine/db/db-versioned-database-test.vala',
'engine/imap/command/imap-create-command-test.vala',
'engine/imap/command/imap-fetch-command-test.vala',
'engine/imap/message/imap-data-format-test.vala',
'engine/imap/message/imap-mailbox-specifier-test.vala',
'engine/imap/parameter/imap-list-parameter-test.vala',
'engine/imap/response/imap-fetch-data-decoder-test.vala',
'engine/imap/response/imap-namespace-response-test.vala',
'engine/imap/transport/imap-client-connection-test.vala',
'engine/imap/transport/imap-client-session-test.vala',
'engine/imap/transport/imap-deserializer-test.vala',
'engine/imap-db/imap-db-account-test.vala',
'engine/imap-db/imap-db-attachment-test.vala',
Make database classes more amenable to asynchronous use. This makes both the open() and open_connection() methods on Geary.DB.Database asynchronous, which allows the VersionedDatabase open_background() and its hackery to be removed, and upgrades to be performed asynchronously as well. It also adds a exec_transaction_async() method to Connection, allowing an existing object to also be used to establish an async transaction. * src/engine/db/db-connection.vala (Connection): Add exec_transaction_async method, update doc comments. * src/engine/db/db-database.vala (Database): Make open and open_connection async by executing SQLite code in a background thread, update call sites. Move job management code out of exec_transaction_async into a new internal add_async_job() method so it can be used by Connection. Add unit tests. * src/engine/db/db-transaction-async-job.vala (TransactionAsyncJob): Add an optional internal connection method and make the job's cancellable an internal property so a Connection instance can specify itself for the transaction. * src/engine/db/db-versioned-database.vala (VersionedDatabase): Remove open_background() hack since open() is now async. Make version upgrade hooks for derived classes async and update call sites. Use a Nonblocking.Mutex rather than GLib mutex so upgrade exclusion works asynchronously. Add unit tests. * src/engine/imap-db/imap-db-database.vala (Database): Make database upgrade methods async and execute SQL in async instructions now that the bases classes support it. Add unit tests.
2018-05-08 09:18:06 +09:30
'engine/imap-db/imap-db-database-test.vala',
'engine/imap-db/imap-db-email-identifier-test.vala',
'engine/imap-db/imap-db-folder-test.vala',
'engine/imap-engine/account-processor-test.vala',
'engine/imap-engine/imap-engine-generic-account-test.vala',
'engine/mime/mime-content-type-test.vala',
'engine/outbox/outbox-email-identifier-test.vala',
'engine/rfc822/rfc822-mailbox-address-test.vala',
'engine/rfc822/rfc822-mailbox-addresses-test.vala',
'engine/rfc822/rfc822-message-test.vala',
'engine/rfc822/rfc822-message-data-test.vala',
'engine/rfc822/rfc822-part-test.vala',
'engine/rfc822/rfc822-utils-test.vala',
'engine/util-ascii-test.vala',
'engine/util-config-file-test.vala',
'engine/util-html-test.vala',
'engine/util-idle-manager-test.vala',
'engine/util-inet-test.vala',
'engine/util-string-test.vala',
'engine/util-timeout-manager-test.vala',
test_engine_resources
]
test_client_sources = [
'test-case.vala',
'test-client.vala',
'client/accounts/accounts-manager-test.vala',
'client/application/application-certificate-manager-test.vala',
'client/application/application-client-test.vala',
'client/application/application-configuration-test.vala',
'client/components/components-validator-test.vala',
'client/components/components-web-view-test-case.vala',
'client/components/components-web-view-test.vala',
'client/composer/composer-web-view-test.vala',
'client/composer/composer-widget-test.vala',
'client/util/util-cache-test.vala',
'client/util/util-email-test.vala',
'client/util/util-js-test.vala',
'js/components-page-state-test.vala',
'js/composer-page-state-test.vala',
'js/conversation-page-state-test.vala',
geary_compiled_schema,
geary_resources
]
test_js_sources = [
'test-case.vala',
'test-js.vala',
'client/components/components-web-view-test-case.vala',
'js/components-page-state-test.vala',
'js/composer-page-state-test.vala',
'js/conversation-page-state-test.vala',
geary_compiled_schema,
geary_resources
]
test_integration_sources = [
'test-case.vala',
'test-integration.vala',
'integration/imap/client-session.vala',
2019-04-24 17:18:03 +10:00
'integration/smtp/client-session.vala',
]
2019-04-19 13:23:00 +10:00
# Engine tests
test_engine_dependencies = [
config_dep,
glib,
engine_internal_dep,
vala_unit_dep,
2019-04-19 13:23:00 +10:00
]
test_engine_dependencies += engine_dependencies
2019-04-19 13:23:00 +10:00
test_engine_vala_args = geary_vala_args
2019-04-19 13:23:00 +10:00
if libytnef.found()
test_engine_dependencies += libytnef
test_engine_vala_args += [
2019-04-19 13:23:00 +10:00
'-D', 'WITH_TNEF_SUPPORT'
]
endif
test_engine_bin = executable('test-engine',
test_engine_sources + libmock_sources,
dependencies: test_engine_dependencies,
vala_args: test_engine_vala_args,
c_args: geary_c_args,
)
2019-04-19 13:23:00 +10:00
# Client tests
test_client_dependencies = [
config_dep,
glib,
client_internal_dep,
vala_unit_dep,
2019-04-19 13:23:00 +10:00
]
test_client_dependencies += client_dependencies
2019-04-19 13:23:00 +10:00
test_client_bin = executable('test-client',
test_client_sources + libmock_sources,
dependencies: test_client_dependencies,
vala_args: geary_vala_args,
c_args: geary_c_args,
build_rpath: client_build_dir,
)
test_js_dependencies = [
config_dep,
glib,
client_internal_dep,
vala_unit_dep,
]
test_js_dependencies += client_dependencies
test_js_bin = executable('test-js',
test_js_sources + libmock_sources,
dependencies: test_js_dependencies,
vala_args: geary_vala_args,
c_args: geary_c_args,
build_rpath: client_build_dir,
)
2019-04-19 13:23:00 +10:00
# Integration tests
test_integration_bin = executable('test-integration',
test_integration_sources,
dependencies: [
config_dep,
glib,
engine_dep,
gee,
gio,
gmime,
vala_unit_dep,
webkit2gtk,
],
vala_args: geary_vala_args,
c_args: geary_c_args,
)
test(
'engine-tests',
test_engine_bin,
depends: [ engine_lib ]
)
test(
'client-tests',
test_client_bin,
depends: [ client_lib, web_process ]
)
test(
'js-tests',
test_js_bin,
depends: [ client_lib, web_process ]
)