2018-05-09 17:34:56 +10:00
|
|
|
subdir('data')
|
|
|
|
|
|
2020-08-10 16:13:57 +10:00
|
|
|
# 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',
|
|
|
|
|
]
|
|
|
|
|
|
2020-08-10 16:53:39 +10:00
|
|
|
test_engine_sources = [
|
2020-05-09 16:04:22 +10:00
|
|
|
'test-case.vala',
|
2020-05-08 18:30:35 +10:00
|
|
|
'test-server.vala',
|
2020-05-09 16:04:22 +10:00
|
|
|
'test-engine.vala',
|
2017-12-09 00:45:29 +01:00
|
|
|
|
2019-06-10 08:54:05 +10:00
|
|
|
'engine/common/common-contact-harvester-mock.vala',
|
2018-03-09 11:58:02 +11:00
|
|
|
|
2018-07-02 19:03:42 +10:00
|
|
|
'engine/api/geary-account-information-test.vala',
|
2017-12-09 00:45:29 +01:00
|
|
|
'engine/api/geary-attachment-test.vala',
|
2020-08-03 14:13:34 +10:00
|
|
|
'engine/api/geary-composed-email-test.vala',
|
|
|
|
|
'engine/api/geary-email-test.vala',
|
2017-12-09 00:45:29 +01:00
|
|
|
'engine/api/geary-engine-test.vala',
|
Convert Geary.FolderRoot to be an actual root, not just a top-level
Instead of each top-level IMAP folder being a FolderRoot object, then
children of that being FolderPath objects, this makes FolderRoot an
"empty" FolderPath, so that both top-level and descendant folders are
plain FolderPath objects. Aside from being more technically correct,
this means that empty namespace roots can now be used interchangably
with non-empty namespace roots (addressing issue #181), and custom
folder implementations no longer need to provide their own trivial,
custom FolderRoot.
To support this, a notion of an IMAP root and a local root have been
added from which all remote and local folder paths are now derived,
existing places that assume top-level == root have been fixed, and
unit tests have been added.
2019-01-14 12:10:48 +11:00
|
|
|
'engine/api/geary-folder-path-test.vala',
|
2018-09-05 23:10:30 +10:00
|
|
|
'engine/api/geary-service-information-test.vala',
|
2017-12-15 15:11:24 +11:00
|
|
|
'engine/app/app-conversation-test.vala',
|
2018-04-04 15:58:44 +10:00
|
|
|
'engine/app/app-conversation-monitor-test.vala',
|
2017-12-15 15:11:24 +11:00
|
|
|
'engine/app/app-conversation-set-test.vala',
|
2019-06-09 21:56:25 +10:00
|
|
|
'engine/common/common-contact-store-impl-test.vala',
|
2019-06-10 08:43:40 +10:00
|
|
|
'engine/common/common-contact-harvester-test.vala',
|
2020-11-05 00:21:39 +11:00
|
|
|
'engine/common/common-fts-search-query-test.vala',
|
2018-05-08 09:18:06 +09:30
|
|
|
'engine/db/db-database-test.vala',
|
|
|
|
|
'engine/db/db-versioned-database-test.vala',
|
2017-12-09 00:45:29 +01:00
|
|
|
'engine/imap/command/imap-create-command-test.vala',
|
2018-07-26 11:25:35 +10:00
|
|
|
'engine/imap/command/imap-fetch-command-test.vala',
|
2018-07-20 13:29:09 +10:00
|
|
|
'engine/imap/message/imap-data-format-test.vala',
|
2018-07-20 13:35:26 +10:00
|
|
|
'engine/imap/message/imap-mailbox-specifier-test.vala',
|
2018-07-01 14:47:23 +10:00
|
|
|
'engine/imap/parameter/imap-list-parameter-test.vala',
|
2020-08-18 11:40:14 +10:00
|
|
|
'engine/imap/response/imap-fetch-data-decoder-test.vala',
|
2017-12-09 00:45:29 +01:00
|
|
|
'engine/imap/response/imap-namespace-response-test.vala',
|
2019-12-29 01:56:48 +10:30
|
|
|
'engine/imap/transport/imap-client-connection-test.vala',
|
2019-12-29 12:26:38 +10:30
|
|
|
'engine/imap/transport/imap-client-session-test.vala',
|
2017-12-09 00:45:29 +01:00
|
|
|
'engine/imap/transport/imap-deserializer-test.vala',
|
2019-01-14 11:01:03 +11:00
|
|
|
'engine/imap-db/imap-db-account-test.vala',
|
2018-04-28 20:56:09 +10:00
|
|
|
'engine/imap-db/imap-db-attachment-test.vala',
|
2018-05-08 09:18:06 +09:30
|
|
|
'engine/imap-db/imap-db-database-test.vala',
|
2018-01-03 15:01:21 +11:00
|
|
|
'engine/imap-db/imap-db-email-identifier-test.vala',
|
2019-02-13 18:41:49 +11:00
|
|
|
'engine/imap-db/imap-db-folder-test.vala',
|
2018-01-12 12:23:33 +11:00
|
|
|
'engine/imap-engine/account-processor-test.vala',
|
2019-10-30 14:12:52 +11:00
|
|
|
'engine/imap-engine/imap-engine-generic-account-test.vala',
|
2019-11-23 10:38:40 +11:00
|
|
|
'engine/mime/mime-content-type-test.vala',
|
2018-01-03 15:01:21 +11:00
|
|
|
'engine/outbox/outbox-email-identifier-test.vala',
|
2020-05-05 22:03:04 +10:00
|
|
|
'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',
|
2018-05-17 15:41:01 +10:00
|
|
|
'engine/util-ascii-test.vala',
|
2018-05-25 00:32:17 +10:00
|
|
|
'engine/util-config-file-test.vala',
|
2017-12-09 00:45:29 +01:00
|
|
|
'engine/util-html-test.vala',
|
|
|
|
|
'engine/util-idle-manager-test.vala',
|
|
|
|
|
'engine/util-inet-test.vala',
|
2018-01-29 09:57:24 +10:30
|
|
|
'engine/util-string-test.vala',
|
2018-05-09 17:34:56 +10:00
|
|
|
'engine/util-timeout-manager-test.vala',
|
|
|
|
|
|
2020-08-10 16:53:39 +10:00
|
|
|
test_engine_resources
|
2017-12-15 15:11:24 +11:00
|
|
|
]
|
|
|
|
|
|
2020-08-10 16:53:39 +10:00
|
|
|
test_client_sources = [
|
2020-05-09 16:04:22 +10:00
|
|
|
'test-case.vala',
|
2017-12-15 15:11:24 +11:00
|
|
|
'test-client.vala',
|
2017-12-09 00:45:29 +01:00
|
|
|
|
2018-07-23 14:38:57 +10:00
|
|
|
'client/accounts/accounts-manager-test.vala',
|
2020-08-25 16:37:08 +10:00
|
|
|
'client/application/application-certificate-manager-test.vala',
|
2019-11-13 10:54:11 +11:00
|
|
|
'client/application/application-client-test.vala',
|
2019-11-07 13:26:47 +11:00
|
|
|
'client/application/application-configuration-test.vala',
|
2019-11-20 14:45:04 +11:00
|
|
|
'client/components/components-validator-test.vala',
|
2020-08-25 22:10:28 +10:00
|
|
|
'client/components/components-web-view-test-case.vala',
|
|
|
|
|
'client/components/components-web-view-test.vala',
|
2017-12-09 00:45:29 +01:00
|
|
|
'client/composer/composer-web-view-test.vala',
|
2020-08-10 18:13:09 +10:00
|
|
|
'client/composer/composer-widget-test.vala',
|
2019-03-17 13:48:15 +11:00
|
|
|
'client/util/util-cache-test.vala',
|
2019-03-09 20:06:45 +11:00
|
|
|
'client/util/util-email-test.vala',
|
2019-07-21 10:00:32 +10:00
|
|
|
'client/util/util-js-test.vala',
|
2017-12-09 00:45:29 +01:00
|
|
|
|
2020-08-25 22:10:28 +10:00
|
|
|
'js/components-page-state-test.vala',
|
2017-12-09 00:45:29 +01:00
|
|
|
'js/composer-page-state-test.vala',
|
|
|
|
|
'js/conversation-page-state-test.vala',
|
2017-12-15 15:11:24 +11:00
|
|
|
|
2017-12-12 15:34:41 +11:00
|
|
|
geary_compiled_schema,
|
|
|
|
|
geary_resources
|
2017-12-09 00:45:29 +01:00
|
|
|
]
|
|
|
|
|
|
2021-02-24 14:58:58 +01:00
|
|
|
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
|
|
|
|
|
]
|
|
|
|
|
|
2020-08-10 16:53:39 +10:00
|
|
|
test_integration_sources = [
|
2020-05-09 16:04:22 +10:00
|
|
|
'test-case.vala',
|
2019-03-31 01:42:08 +11:00
|
|
|
'test-integration.vala',
|
|
|
|
|
|
|
|
|
|
'integration/imap/client-session.vala',
|
2019-04-24 17:18:03 +10:00
|
|
|
'integration/smtp/client-session.vala',
|
2019-03-31 01:42:08 +11:00
|
|
|
]
|
|
|
|
|
|
2019-04-19 13:23:00 +10:00
|
|
|
# Engine tests
|
|
|
|
|
|
2020-08-10 16:53:39 +10:00
|
|
|
test_engine_dependencies = [
|
2025-12-07 01:21:41 +01:00
|
|
|
config_dep,
|
Adapt vala-unit and tests to GLib 2.70 and later
`GLib.TestSuite` is a special type of object, as it doesn't actually
have an associated copy function or a reference/unreference function.
In practice, that actually means there's no way to actually have 2
strong references to such an object, or to copy it somehow. Due to the
way GObject properties in Vala work, that means you can't really use
them either.
Ever since vala commit 5f0a146f65, this got reflected properly in the
internally maintained GLib VAPI (as people were experiencing double
frees otherwise), but it was added only conditionally for GLib 2.70 or
later. In practice, that means you only get vala compiler issues if you
(impliclty) set `--target-glib=2.70` (or a later version).
To fix this for vala-unit and our own Geary tests, this commit changes
the `ValaUnit.TestCase` class to only allow "stealing" the strong
reference to the `GLib.TestSuite`, rather than somehowing allowing
people to hold a weak reference, and by also making it a protected field
rather than a property.
Since this changes the API of ValaUnit, we also bump the version. In
general though, I hope people aren't using ValaUnit externally, since
these types of API/ABI breaks can happen with Vala libraries.
Link: https://gitlab.gnome.org/GNOME/vala/-/commit/5f0a146f65673379fc84c3cd8e6bca826ffad96f
2025-12-07 10:09:15 +01:00
|
|
|
glib,
|
2020-08-10 16:53:39 +10:00
|
|
|
engine_internal_dep,
|
2020-05-08 18:30:35 +10:00
|
|
|
vala_unit_dep,
|
2019-04-19 13:23:00 +10:00
|
|
|
]
|
2020-08-10 16:53:39 +10:00
|
|
|
test_engine_dependencies += engine_dependencies
|
2019-04-19 13:23:00 +10:00
|
|
|
|
2020-08-10 16:53:39 +10:00
|
|
|
test_engine_vala_args = geary_vala_args
|
2019-04-19 13:23:00 +10:00
|
|
|
|
2020-10-03 21:06:43 +10:00
|
|
|
if libytnef.found()
|
2020-08-10 16:53:39 +10:00
|
|
|
test_engine_dependencies += libytnef
|
|
|
|
|
test_engine_vala_args += [
|
2019-04-19 13:23:00 +10:00
|
|
|
'-D', 'WITH_TNEF_SUPPORT'
|
|
|
|
|
]
|
|
|
|
|
endif
|
|
|
|
|
|
2020-08-10 16:53:39 +10:00
|
|
|
test_engine_bin = executable('test-engine',
|
|
|
|
|
test_engine_sources + libmock_sources,
|
|
|
|
|
dependencies: test_engine_dependencies,
|
|
|
|
|
vala_args: test_engine_vala_args,
|
2019-09-27 23:56:52 +10:00
|
|
|
c_args: geary_c_args,
|
2017-12-09 00:45:29 +01:00
|
|
|
)
|
2017-12-15 15:11:24 +11:00
|
|
|
|
2019-04-19 13:23:00 +10:00
|
|
|
# Client tests
|
|
|
|
|
|
2020-08-10 16:53:39 +10:00
|
|
|
test_client_dependencies = [
|
2025-12-07 01:21:41 +01:00
|
|
|
config_dep,
|
Adapt vala-unit and tests to GLib 2.70 and later
`GLib.TestSuite` is a special type of object, as it doesn't actually
have an associated copy function or a reference/unreference function.
In practice, that actually means there's no way to actually have 2
strong references to such an object, or to copy it somehow. Due to the
way GObject properties in Vala work, that means you can't really use
them either.
Ever since vala commit 5f0a146f65, this got reflected properly in the
internally maintained GLib VAPI (as people were experiencing double
frees otherwise), but it was added only conditionally for GLib 2.70 or
later. In practice, that means you only get vala compiler issues if you
(impliclty) set `--target-glib=2.70` (or a later version).
To fix this for vala-unit and our own Geary tests, this commit changes
the `ValaUnit.TestCase` class to only allow "stealing" the strong
reference to the `GLib.TestSuite`, rather than somehowing allowing
people to hold a weak reference, and by also making it a protected field
rather than a property.
Since this changes the API of ValaUnit, we also bump the version. In
general though, I hope people aren't using ValaUnit externally, since
these types of API/ABI breaks can happen with Vala libraries.
Link: https://gitlab.gnome.org/GNOME/vala/-/commit/5f0a146f65673379fc84c3cd8e6bca826ffad96f
2025-12-07 10:09:15 +01:00
|
|
|
glib,
|
2020-08-10 18:07:16 +10:00
|
|
|
client_internal_dep,
|
2020-05-08 18:30:35 +10:00
|
|
|
vala_unit_dep,
|
2019-04-19 13:23:00 +10:00
|
|
|
]
|
2020-08-10 16:53:39 +10:00
|
|
|
test_client_dependencies += client_dependencies
|
2019-04-19 13:23:00 +10:00
|
|
|
|
2020-08-10 16:53:39 +10:00
|
|
|
test_client_bin = executable('test-client',
|
|
|
|
|
test_client_sources + libmock_sources,
|
|
|
|
|
dependencies: test_client_dependencies,
|
2019-09-27 23:56:52 +10:00
|
|
|
vala_args: geary_vala_args,
|
|
|
|
|
c_args: geary_c_args,
|
2020-08-10 18:07:16 +10:00
|
|
|
build_rpath: client_build_dir,
|
2017-12-15 15:11:24 +11:00
|
|
|
)
|
|
|
|
|
|
2021-02-24 14:58:58 +01:00
|
|
|
test_js_dependencies = [
|
2025-12-07 01:21:41 +01:00
|
|
|
config_dep,
|
Adapt vala-unit and tests to GLib 2.70 and later
`GLib.TestSuite` is a special type of object, as it doesn't actually
have an associated copy function or a reference/unreference function.
In practice, that actually means there's no way to actually have 2
strong references to such an object, or to copy it somehow. Due to the
way GObject properties in Vala work, that means you can't really use
them either.
Ever since vala commit 5f0a146f65, this got reflected properly in the
internally maintained GLib VAPI (as people were experiencing double
frees otherwise), but it was added only conditionally for GLib 2.70 or
later. In practice, that means you only get vala compiler issues if you
(impliclty) set `--target-glib=2.70` (or a later version).
To fix this for vala-unit and our own Geary tests, this commit changes
the `ValaUnit.TestCase` class to only allow "stealing" the strong
reference to the `GLib.TestSuite`, rather than somehowing allowing
people to hold a weak reference, and by also making it a protected field
rather than a property.
Since this changes the API of ValaUnit, we also bump the version. In
general though, I hope people aren't using ValaUnit externally, since
these types of API/ABI breaks can happen with Vala libraries.
Link: https://gitlab.gnome.org/GNOME/vala/-/commit/5f0a146f65673379fc84c3cd8e6bca826ffad96f
2025-12-07 10:09:15 +01:00
|
|
|
glib,
|
2021-02-24 14:58:58 +01:00
|
|
|
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
|
|
|
|
|
|
2020-08-10 16:53:39 +10:00
|
|
|
test_integration_bin = executable('test-integration',
|
|
|
|
|
test_integration_sources,
|
2019-03-31 01:42:08 +11:00
|
|
|
dependencies: [
|
2025-12-07 01:21:41 +01:00
|
|
|
config_dep,
|
Adapt vala-unit and tests to GLib 2.70 and later
`GLib.TestSuite` is a special type of object, as it doesn't actually
have an associated copy function or a reference/unreference function.
In practice, that actually means there's no way to actually have 2
strong references to such an object, or to copy it somehow. Due to the
way GObject properties in Vala work, that means you can't really use
them either.
Ever since vala commit 5f0a146f65, this got reflected properly in the
internally maintained GLib VAPI (as people were experiencing double
frees otherwise), but it was added only conditionally for GLib 2.70 or
later. In practice, that means you only get vala compiler issues if you
(impliclty) set `--target-glib=2.70` (or a later version).
To fix this for vala-unit and our own Geary tests, this commit changes
the `ValaUnit.TestCase` class to only allow "stealing" the strong
reference to the `GLib.TestSuite`, rather than somehowing allowing
people to hold a weak reference, and by also making it a protected field
rather than a property.
Since this changes the API of ValaUnit, we also bump the version. In
general though, I hope people aren't using ValaUnit externally, since
these types of API/ABI breaks can happen with Vala libraries.
Link: https://gitlab.gnome.org/GNOME/vala/-/commit/5f0a146f65673379fc84c3cd8e6bca826ffad96f
2025-12-07 10:09:15 +01:00
|
|
|
glib,
|
2020-08-10 16:53:39 +10:00
|
|
|
engine_dep,
|
2019-03-31 01:42:08 +11:00
|
|
|
gee,
|
|
|
|
|
gio,
|
|
|
|
|
gmime,
|
2020-05-08 18:30:35 +10:00
|
|
|
vala_unit_dep,
|
2019-03-31 01:42:08 +11:00
|
|
|
webkit2gtk,
|
|
|
|
|
],
|
2019-09-27 23:56:52 +10:00
|
|
|
vala_args: geary_vala_args,
|
|
|
|
|
c_args: geary_c_args,
|
2019-03-31 01:42:08 +11:00
|
|
|
)
|
|
|
|
|
|
2021-04-23 00:36:54 +10:00
|
|
|
test(
|
|
|
|
|
'engine-tests',
|
|
|
|
|
test_engine_bin,
|
|
|
|
|
depends: [ engine_lib ]
|
|
|
|
|
)
|
|
|
|
|
test(
|
|
|
|
|
'client-tests',
|
|
|
|
|
test_client_bin,
|
|
|
|
|
depends: [ client_lib, web_process ]
|
|
|
|
|
)
|
2021-02-24 14:58:58 +01:00
|
|
|
test(
|
|
|
|
|
'js-tests',
|
|
|
|
|
test_js_bin,
|
|
|
|
|
depends: [ client_lib, web_process ]
|
|
|
|
|
)
|