2018-06-11 11:46:08 +00:00
|
|
|
if get_option('tests')
|
|
|
|
|
|
|
|
test_env = [
|
|
|
|
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
|
|
|
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
|
|
|
|
'G_DEBUG=gc-friendly,fatal-warnings',
|
|
|
|
'GSETTINGS_BACKEND=memory',
|
|
|
|
'PYTHONDONTWRITEBYTECODE=yes',
|
|
|
|
'MALLOC_CHECK_=2',
|
|
|
|
]
|
|
|
|
|
|
|
|
test_cflags = [
|
|
|
|
'-fPIE',
|
2019-12-09 15:37:22 +00:00
|
|
|
'-DFOR_TESTING',
|
2020-03-20 17:33:59 +00:00
|
|
|
'-Wno-error=deprecated-declarations',
|
|
|
|
'-DPLUGIN_BUILDDIR="@0@"'.format(full_calls_plugin_builddir),
|
2018-06-11 11:46:08 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
test_link_args = [
|
|
|
|
'-fPIC',
|
|
|
|
]
|
|
|
|
|
2018-06-13 13:38:51 +00:00
|
|
|
tests = [
|
|
|
|
[ 'provider', [] ],
|
|
|
|
[ 'origin', [ 'provider' ] ],
|
|
|
|
[ 'call', [ 'provider', 'origin' ] ],
|
2018-06-11 11:46:08 +00:00
|
|
|
]
|
|
|
|
|
2018-06-13 13:38:51 +00:00
|
|
|
foreach test : tests
|
|
|
|
name = test[0]
|
2018-06-11 11:46:08 +00:00
|
|
|
|
2018-06-13 13:38:51 +00:00
|
|
|
setup_bases = test[1]
|
|
|
|
setup_bases += name
|
|
|
|
|
|
|
|
test_sources = []
|
|
|
|
foreach base : setup_bases
|
|
|
|
test_sources += [ 'setup-' + base + '.c',
|
|
|
|
'setup-' + base + '.h' ]
|
2018-06-11 11:46:08 +00:00
|
|
|
endforeach
|
2018-06-13 13:38:51 +00:00
|
|
|
test_sources += [ 'test-' + name + '.c',
|
|
|
|
'common.h' ]
|
2018-06-11 11:46:08 +00:00
|
|
|
|
2018-06-13 13:38:51 +00:00
|
|
|
t = executable(name, test_sources,
|
2018-11-23 14:34:41 +00:00
|
|
|
calls_sources, dummy_sources, calls_enum_sources, calls_resources,
|
2019-08-13 10:38:40 +00:00
|
|
|
wl_proto_sources, wayland_sources,
|
2018-06-13 13:38:51 +00:00
|
|
|
c_args : test_cflags,
|
|
|
|
link_args: test_link_args,
|
2019-10-28 10:21:09 +00:00
|
|
|
link_with : calls_vala,
|
2018-06-13 13:38:51 +00:00
|
|
|
dependencies: calls_deps,
|
2018-11-23 14:34:41 +00:00
|
|
|
include_directories : [
|
2019-08-13 10:38:40 +00:00
|
|
|
calls_includes,
|
|
|
|
dummy_include,
|
2018-11-23 14:34:41 +00:00
|
|
|
]
|
2018-06-13 13:38:51 +00:00
|
|
|
)
|
|
|
|
test(name, t, env: test_env)
|
2018-06-11 11:46:08 +00:00
|
|
|
endforeach
|
|
|
|
|
2020-03-20 17:33:59 +00:00
|
|
|
test_sources = [ 'test-manager.c' ]
|
|
|
|
|
|
|
|
t = executable('manager', test_sources,
|
|
|
|
calls_sources, calls_enum_sources, calls_resources,
|
|
|
|
wl_proto_sources, wayland_sources,
|
|
|
|
c_args : test_cflags,
|
|
|
|
link_args: test_link_args,
|
|
|
|
link_with : calls_vala,
|
|
|
|
dependencies: calls_deps,
|
|
|
|
include_directories : [
|
|
|
|
calls_includes
|
|
|
|
]
|
|
|
|
)
|
|
|
|
test('manager', t, env: test_env)
|
|
|
|
|
|
|
|
|
2018-06-11 11:46:08 +00:00
|
|
|
endif
|