tests: Add basic unit tests for fp-context

Link the tests with the private library using an utils library that will
be useful to share other tests functions
This commit is contained in:
Marco Trevisan (Treviño)
2019-12-05 14:38:41 +01:00
parent eeddd8c7bc
commit da46f53e82
6 changed files with 225 additions and 4 deletions

View File

@@ -48,6 +48,32 @@ if get_option('introspection')
endforeach
endif
if 'virtual_image' in drivers
test_utils = static_library('fprint-test-utils',
sources: ['test-utils.c'],
dependencies: libfprint_private_dep,
install: false)
unit_tests = [
'fp-context',
]
foreach test_name: unit_tests
basename = 'test-' + test_name
test_exe = executable(basename,
sources: basename + '.c',
dependencies: libfprint_private_dep,
c_args: common_cflags,
link_with: test_utils)
test(test_name,
find_program('test-runner.sh'),
suite: ['unit-tests'],
args: [test_exe],
env: envs,
)
endforeach
endif
gdb = find_program('gdb', required: false)
if gdb.found()
add_test_setup('gdb',