tests/meson: Support unit-tests non depending on virtual driver
Since tests depending on the fake device don't depend on virtual-image driver anymore, let's change the way we organize the things, by putting everything in the test lib, but enabling unit-tests depending on what they depend on.
This commit is contained in:
parent
f578ebe82d
commit
324258bc8c
1 changed files with 27 additions and 24 deletions
|
@ -48,7 +48,6 @@ if get_option('introspection')
|
|||
endforeach
|
||||
endif
|
||||
|
||||
if 'virtual_image' in drivers
|
||||
test_utils = static_library('fprint-test-utils',
|
||||
sources: [
|
||||
'test-utils.c',
|
||||
|
@ -57,10 +56,14 @@ if 'virtual_image' in drivers
|
|||
dependencies: libfprint_private_dep,
|
||||
install: false)
|
||||
|
||||
unit_tests = [
|
||||
unit_tests = []
|
||||
|
||||
if 'virtual_image' in drivers
|
||||
unit_tests += [
|
||||
'fp-context',
|
||||
'fp-device',
|
||||
]
|
||||
endif
|
||||
|
||||
foreach test_name: unit_tests
|
||||
basename = 'test-' + test_name
|
||||
|
@ -68,7 +71,8 @@ if 'virtual_image' in drivers
|
|||
sources: basename + '.c',
|
||||
dependencies: libfprint_private_dep,
|
||||
c_args: common_cflags,
|
||||
link_with: test_utils)
|
||||
link_with: test_utils,
|
||||
)
|
||||
test(test_name,
|
||||
find_program('test-runner.sh'),
|
||||
suite: ['unit-tests'],
|
||||
|
@ -76,7 +80,6 @@ if 'virtual_image' in drivers
|
|||
env: envs,
|
||||
)
|
||||
endforeach
|
||||
endif
|
||||
|
||||
gdb = find_program('gdb', required: false)
|
||||
if gdb.found()
|
||||
|
|
Loading…
Reference in a new issue