2018-06-11 12:46:08 +01:00
|
|
|
if get_option('tests')
|
|
|
|
|
|
|
|
test_env = [
|
|
|
|
'G_DEBUG=gc-friendly,fatal-warnings',
|
|
|
|
'GSETTINGS_BACKEND=memory',
|
2022-12-21 19:13:25 +01:00
|
|
|
'LANGUAGE=C',
|
|
|
|
'LC_ALL=C',
|
2018-06-11 12:46:08 +01:00
|
|
|
'PYTHONDONTWRITEBYTECODE=yes',
|
|
|
|
'MALLOC_CHECK_=2',
|
2020-06-05 12:04:23 +02:00
|
|
|
'NO_AT_BRIDGE=1',
|
2021-09-23 10:10:25 +02:00
|
|
|
'GSETTINGS_SCHEMA_DIR=@0@/data'.format(meson.project_build_root()),
|
2022-11-19 14:08:11 +01:00
|
|
|
'CALLS_PLUGIN_DIR=@0@/plugins'.format(meson.project_build_root()),
|
2023-01-15 09:53:09 +01:00
|
|
|
'FOLKS_BACKENDS_ALLOWED=key-file',
|
|
|
|
'FOLKS_PRIMARY_STORE=key-file',
|
2023-01-16 09:17:20 +01:00
|
|
|
'CALLS_RECORD_DIR=@0@/tests/record-db'.format(meson.project_build_root()),
|
2023-03-17 18:50:53 +01:00
|
|
|
'CALLS_SIP_ACCOUNT_FILE=@0@/tests/sip-account.cfg'.format(meson.project_build_root()),
|
2018-06-11 12:46:08 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
test_cflags = [
|
2021-04-06 12:07:14 +02:00
|
|
|
'-DFOR_TESTING',
|
2020-03-20 18:33:59 +01:00
|
|
|
'-Wno-error=deprecated-declarations',
|
2018-06-11 12:46:08 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
test_link_args = [
|
|
|
|
'-fPIC',
|
|
|
|
]
|
|
|
|
|
2023-01-14 13:09:00 +01:00
|
|
|
dbus_service_conf = configuration_data()
|
|
|
|
dbus_service_conf.set('CALLS_BUILD_DIR', '@0@'.format(builddir))
|
|
|
|
dbus_service_conf.set('CALLS_BUILD_DIR_STR', '"@0@"'.format(builddir))
|
|
|
|
dbus_service_conf.set('CALLS_DBUS_NAME', '"org.gnome.Calls"')
|
|
|
|
dbus_service_conf.set('CALLS_DBUS_OBJECT_PATH', '"/org/gnome/Calls"')
|
|
|
|
|
|
|
|
dbus_config_h = configure_file(output : 'calls-dbus-config.h',
|
|
|
|
configuration : dbus_service_conf)
|
|
|
|
|
|
|
|
test_includes = include_directories('.')
|
|
|
|
|
|
|
|
subdir('mock')
|
|
|
|
subdir('services')
|
2022-02-03 07:49:55 +01:00
|
|
|
|
2020-03-20 18:33:59 +01:00
|
|
|
test_sources = [ 'test-manager.c' ]
|
|
|
|
|
|
|
|
t = executable('manager', test_sources,
|
|
|
|
c_args : test_cflags,
|
2023-01-15 10:49:12 +01:00
|
|
|
link_args: test_link_args,
|
2021-06-22 04:20:10 +02:00
|
|
|
pie: true,
|
2021-05-17 18:51:54 +05:30
|
|
|
link_with : [calls_vala, libcalls],
|
2020-03-20 18:33:59 +01:00
|
|
|
dependencies: calls_deps,
|
|
|
|
include_directories : [
|
|
|
|
calls_includes
|
|
|
|
]
|
|
|
|
)
|
2022-11-21 12:24:34 +01:00
|
|
|
test('manager', t, env: test_env, depends: calls_plugins)
|
2020-03-20 18:33:59 +01:00
|
|
|
|
2021-03-23 14:20:24 +01:00
|
|
|
test_sources = [ 'test-plugins.c' ]
|
|
|
|
|
|
|
|
t = executable('plugins', test_sources,
|
2021-04-06 12:44:46 +02:00
|
|
|
calls_sources,
|
2021-03-23 14:20:24 +01:00
|
|
|
c_args : test_cflags,
|
|
|
|
link_args: test_link_args,
|
2021-06-22 04:20:10 +02:00
|
|
|
pie: true,
|
2021-05-17 18:51:54 +05:30
|
|
|
link_with : [calls_vala, libcalls],
|
2021-03-23 14:20:24 +01:00
|
|
|
dependencies: calls_deps,
|
|
|
|
include_directories : [
|
|
|
|
calls_includes
|
|
|
|
]
|
|
|
|
)
|
2022-11-21 12:24:34 +01:00
|
|
|
test('plugins', t, env: test_env, depends: calls_plugins)
|
2020-03-20 18:33:59 +01:00
|
|
|
|
2021-04-30 16:24:07 +02:00
|
|
|
test_sources = [ 'test-util.c' ]
|
|
|
|
t = executable('util', test_sources,
|
|
|
|
c_args : test_cflags,
|
|
|
|
link_args: test_link_args,
|
2021-06-22 04:20:10 +02:00
|
|
|
pie: true,
|
2021-04-30 16:24:07 +02:00
|
|
|
link_with : [calls_vala, libcalls],
|
|
|
|
dependencies: calls_deps,
|
|
|
|
include_directories : [
|
|
|
|
calls_includes,
|
|
|
|
]
|
|
|
|
)
|
|
|
|
test('util', t, env: test_env)
|
|
|
|
|
2022-02-01 22:24:39 +01:00
|
|
|
test_sources = [ 'test-ui-call.c', 'mock-call.c', 'mock-call.h' ]
|
2022-02-01 19:13:16 +01:00
|
|
|
t = executable('ui-call', test_sources,
|
|
|
|
c_args : test_cflags,
|
2023-01-15 10:49:12 +01:00
|
|
|
link_args : test_link_args,
|
2022-02-01 19:13:16 +01:00
|
|
|
pie: true,
|
|
|
|
link_with : [calls_vala, libcalls],
|
|
|
|
dependencies : calls_deps,
|
|
|
|
include_directories : [
|
|
|
|
calls_includes
|
|
|
|
]
|
|
|
|
)
|
|
|
|
test('ui-call', t, env: test_env)
|
|
|
|
|
2022-09-19 19:03:17 +02:00
|
|
|
test_sources = [
|
2023-01-15 10:52:57 +01:00
|
|
|
'mock-call.c', 'mock-call.h',
|
2022-09-19 19:03:17 +02:00
|
|
|
'test-ringer.c'
|
|
|
|
]
|
|
|
|
|
|
|
|
t = executable('ringer', test_sources,
|
|
|
|
c_args : test_cflags,
|
2023-01-15 10:49:12 +01:00
|
|
|
link_args: test_link_args,
|
2022-09-19 19:03:17 +02:00
|
|
|
pie: true,
|
2022-11-19 15:54:43 +01:00
|
|
|
link_with : [calls_vala, libcalls, libfeedback],
|
2022-09-19 19:03:17 +02:00
|
|
|
dependencies: calls_deps,
|
|
|
|
include_directories : [
|
|
|
|
calls_includes,
|
|
|
|
]
|
|
|
|
)
|
2022-11-19 15:54:43 +01:00
|
|
|
test('ringer', t, env: test_env)
|
2021-10-22 07:23:29 +02:00
|
|
|
|
2022-02-18 09:08:55 +01:00
|
|
|
test_sources = [ 'test-contacts.c' ]
|
|
|
|
t = executable('contacts', test_sources,
|
|
|
|
c_args : test_cflags,
|
|
|
|
link_args: test_link_args,
|
|
|
|
pie: true,
|
|
|
|
link_with : [calls_vala, libcalls],
|
|
|
|
dependencies: calls_deps,
|
|
|
|
include_directories : [
|
|
|
|
calls_includes,
|
|
|
|
]
|
|
|
|
)
|
|
|
|
test('contacts', t, env: test_env)
|
|
|
|
|
2022-05-11 09:54:13 +02:00
|
|
|
test_sources = [ 'test-settings.c' ]
|
|
|
|
t = executable('settings', test_sources,
|
|
|
|
c_args : test_cflags,
|
|
|
|
link_args: test_link_args,
|
|
|
|
pie: true,
|
|
|
|
link_with : [calls_vala, libcalls],
|
|
|
|
dependencies: calls_deps,
|
|
|
|
include_directories : [
|
|
|
|
calls_includes,
|
|
|
|
]
|
|
|
|
)
|
|
|
|
test('settings', t, env: test_env)
|
|
|
|
|
2023-01-14 13:09:33 +01:00
|
|
|
test_sources = ['test-dbus.c']
|
|
|
|
t = executable('dbus', test_sources, generated_dbus_sources,
|
|
|
|
c_args : test_cflags,
|
|
|
|
link_args: test_link_args,
|
|
|
|
pie: true,
|
|
|
|
link_with : [calls_vala, libcalls],
|
|
|
|
dependencies: calls_deps,
|
|
|
|
include_directories : [
|
|
|
|
calls_includes,
|
|
|
|
]
|
|
|
|
)
|
|
|
|
test('dbus', t, env: test_env)
|
|
|
|
|
2023-01-16 09:19:21 +01:00
|
|
|
dbus_run_session = find_program('dbus-run-session')
|
|
|
|
|
|
|
|
if dbus_run_session.found ()
|
|
|
|
test_sources = [ 'test-application.c' ]
|
|
|
|
t = executable('application', test_sources, calls_resources,
|
|
|
|
c_args : test_cflags,
|
|
|
|
link_args: test_link_args,
|
|
|
|
pie: true,
|
|
|
|
link_with : [calls_vala, libcalls],
|
|
|
|
dependencies: calls_deps,
|
|
|
|
include_directories : [
|
|
|
|
calls_includes,
|
|
|
|
]
|
|
|
|
)
|
|
|
|
test('application',
|
|
|
|
dbus_run_session,
|
|
|
|
args: t.full_path(),
|
|
|
|
env: test_env,
|
|
|
|
timeout : 300
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2018-06-11 12:46:08 +01:00
|
|
|
endif
|