1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
test_env = [
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
]
test_sources = files(
'dummy-device.c',
'dummy-device-provider.c',
'main.c',
'test-barcodes.c',
'test-camera.c',
'test-device-manager.c',
'test-viewfinder.c',
'utils.c',
)
subdir('data')
test_sources += test_gresources
test_c_args = []
if get_option('barcode_tests_skippable')
test_c_args += '-DBARCODE_TESTS_SKIPPABLE'
endif
test_executable = executable('aperture-tests',
test_sources,
dependencies: libaperture_dep,
c_args: test_c_args,
install: true,
)
test('aperture-tests',
test_executable,
env: test_env,
)
# We could use the built-in, default coverage reports. However, doing it
# manually here allows us to filter the files, so that only files under src/
# are included.
# Otherwise, the tests themselves, the demo project, and some generated source
# files would skew the results.
# This could also be done using a gcovr.cfg file, but meson will use lcov if
# it's installed, which does not obey that file.
if get_option('b_coverage')
test_coverage = run_target('test-coverage', command: ['coverage.sh'])
endif
|