mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-gtk
synced 2026-01-15 13:57:04 +00:00
Instead of linking all object inside spice-client-glib build a library from these object and link to each test. This will allow to override some object file for mocking purposes. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Victor Toso <victortoso@redhat.com>
41 lines
970 B
Meson
41 lines
970 B
Meson
tests_sources = [
|
|
'util.c',
|
|
'coroutine.c',
|
|
'session.c',
|
|
'uri.c',
|
|
'file-transfer.c',
|
|
]
|
|
|
|
if spice_gtk_has_phodav
|
|
tests_sources += 'pipe.c'
|
|
endif
|
|
|
|
if spice_gtk_has_usbredir
|
|
tests_sources += 'cd-emu.c'
|
|
endif
|
|
|
|
if spice_gtk_has_polkit
|
|
tests_sources += [
|
|
'usb-acl-helper.c',
|
|
'mock-acl-helper.c',
|
|
]
|
|
endif
|
|
|
|
# create a static library from a shared one extracting all objects
|
|
# this allows to rewrite part of it if necessary for mocking
|
|
test_lib = \
|
|
static_library('test-lib',
|
|
objects : spice_client_glib_lib.extract_all_objects())
|
|
|
|
foreach src : tests_sources
|
|
name = 'test-@0@'.format(src).split('.')[0]
|
|
exe = executable(name,
|
|
sources : src,
|
|
c_args : '-DTESTDIR="@0@"'.format(meson.current_build_dir()),
|
|
link_with : test_lib,
|
|
dependencies : spice_client_glib_dep)
|
|
if not name.contains('mock-acl-helper')
|
|
test(name, exe)
|
|
endif
|
|
endforeach
|