spiegel-keyman/linux/keyman-system-service/tests/meson.build
Eberhard Beilharz 4f97b3f38e
chore(linux): add a stub unit test to allow successful coverage reporting
Previously keyman-system-service didn't have any unit tests. With the
gcov/lcov versions available for Ubuntu 24.04 Noble this suddenly caused
a failure when trying to generate the test coverage report, although it
worked fine with older versions.

This change adds a do-nothing unit test stub for keyman-system-service.
This allows to generate the coverage reporting with Ubuntu 24.04 Noble.
2025-04-23 18:52:10 +02:00

51 lines
1.1 KiB
Meson

test_service_files = files(
'../src/main.cpp',
'../src/KeymanSystemService.cpp',
'../src/OrderedOutputDevice.cpp',
'KeyboardDeviceMock.cpp',
'OrderedOutputDeviceMock.cpp',
)
deps = [evdev, systemd]
test_c_args = [
'-DKEYMAN_TESTING',
'-DKeyboardDevice=KeyboardDeviceMock',
]
exe = executable(
'keyman-test-service',
sources: [test_service_files],
c_args: test_c_args,
cpp_args: test_c_args,
dependencies: deps,
include_directories: [ '..', '../src' ]
)
# we currently don't have any real unit tests for keyman-system-service.
# The keyman-test-service we build here gets used by the ibus-keyman
# integration tests.
# The unit test we have here is just a stub to make coverage reporting
# happy.
gtk = dependency('gtk+-3.0', version: '>= 2.4')
test_deps = [gtk]
test_env = [
'G_TEST_SRCDIR=' + meson.current_source_dir(),
'G_TEST_BUILDDIR=' + meson.current_build_dir(),
]
test_exe = executable(
'keyman-system-service-tests',
'testfixture.cpp',
dependencies: test_deps,
)
test(
'test-stub',
test_exe,
protocol: 'tap'
)
subdir('services')