From 9b3725617582f2e49da532364fd391a2348347e5 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Mon, 18 Nov 2019 21:17:43 +0100 Subject: [PATCH] tests: Only run tests when introspection bindings are build The tests cannot work without the introspection bindings. So put them into a corresponding if branch and also add the correct dependency on libfprint_typelib for them to be run. --- meson.build | 2 +- tests/meson.build | 57 ++++++++++++++++++++++++++--------------------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/meson.build b/meson.build index a5891c2..6c922e2 100644 --- a/meson.build +++ b/meson.build @@ -6,7 +6,7 @@ project('libfprint', [ 'c', 'cpp' ], 'warning_level=1', 'c_std=c99', ], - meson_version: '>= 0.45.0') + meson_version: '>= 0.46.0') gnome = import('gnome') diff --git a/tests/meson.build b/tests/meson.build index c8bdf76..d02b05a 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -14,31 +14,36 @@ envs.set('FP_DEVICE_EMULATION', '1') envs.set('NO_AT_BRIDGE', '1') -if 'virtual_image' in drivers - test( - 'virtual-image', - find_program('virtual-image.py'), - args: '--verbose', - env: envs, - ) -endif +if get_option('introspection') + if 'virtual_image' in drivers + test( + 'virtual-image', + find_program('virtual-image.py'), + args: '--verbose', + env: envs, + depends: libfprint_typelib, + ) + endif -if 'vfs5011' in drivers - test( - 'vfs5011', - find_program('umockdev-test.py'), - args: join_paths(meson.current_source_dir(), 'vfs5011'), - env: envs, - timeout: 10, - ) -endif + if 'vfs5011' in drivers + test( + 'vfs5011', + find_program('umockdev-test.py'), + args: join_paths(meson.current_source_dir(), 'vfs5011'), + env: envs, + timeout: 10, + depends: libfprint_typelib, + ) + endif -if 'synaptics' in drivers - test( - 'synaptics', - find_program('umockdev-test.py'), - args: join_paths(meson.current_source_dir(), 'synaptics'), - env: envs, - timeout: 10, - ) -endif \ No newline at end of file + if 'synaptics' in drivers + test( + 'synaptics', + find_program('umockdev-test.py'), + args: join_paths(meson.current_source_dir(), 'synaptics'), + env: envs, + timeout: 10, + depends: libfprint_typelib, + ) + endif +endif