From d5ad81cac58acea7a318d4deee193523d2e78b00 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Thu, 6 Mar 2025 08:11:28 +0100 Subject: [PATCH 1/2] tests: Depend on daemon for integration test The carefree developer might try running meson test before meson compile, leaving them with a failing integration test: Start of lfb-integration tests dbus-daemon[326641]: [session uid=1000 pid=326641 pidfd=8] Activating service name='org.sigxcpu.Feedback' requested by ':1.0' (uid=1000 pid=326640 comm="$(pwd)/_build/tests/te") + exec $(pwd)/_build/src/feedbackd $(pwd)/_build/run: 18: exec: $(pwd)/_build/src/feedbackd: not found Signed-off-by: Evangelos Ribeiro Tzaras --- src/meson.build | 2 +- tests/meson.build | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/meson.build b/src/meson.build index 0e688e7..5483aca 100644 --- a/src/meson.build +++ b/src/meson.build @@ -53,7 +53,7 @@ if get_option('daemon') dependencies: fbd_deps, ) - executable( + fbd_exe = executable( 'feedbackd', sources: ['fbd.c', generated_dbus_sources[1]], include_directories: fbd_inc, diff --git a/tests/meson.build b/tests/meson.build index 20c9c74..d879153 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -29,15 +29,10 @@ if get_option('tests') test_lfb_deps = [libfeedback_dep, glib, gio_unix] - lfb_tests = ['lfb-event'] - if get_option('daemon') # The integration test needs the daemon - lfb_tests += 'lfb-integration' + test = 'lfb-integration' subdir('services') - endif - - foreach test : lfb_tests t = executable( 'test-@0@'.format(test), ['test-@0@.c'.format(test)], @@ -46,8 +41,19 @@ if get_option('tests') link_args: test_lfb_link_args, dependencies: test_lfb_deps, ) - test(test, t, env: test_env) - endforeach + test(test, t, env: test_env, depends: fbd_exe) + endif + + test = 'lfb-event' + t = executable( + 'test-@0@'.format(test), + ['test-@0@.c'.format(test)], + c_args: test_lfb_cflags, + pie: true, + link_args: test_lfb_link_args, + dependencies: test_lfb_deps, + ) + test(test, t, env: test_env) # Daemon Unit tests if get_option('daemon') From 9dd6174e53e77713bc57b79a0837513a18b0e502 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Sun, 16 Mar 2025 09:28:45 +0100 Subject: [PATCH 2/2] tests: Depend on compiled schemas The carefree developer might try running meson test before meson compile, leaving them with failing feedback-vibra and feedback-profile tests: Start of feedbackd tests Start of fbd tests Start of feedback-vibra tests fbd-feedback-manager-DEBUG: No vibra capable device found fbd-feedback-manager-DEBUG: Failed to init leds device: No usable LEDs found not ok /feedbackd/fbd/feedback-vibra/pattern - GLib-GIO-FATAL-ERROR: No GSettings schemas are installed on the system Bail out! Signed-off-by: Evangelos Ribeiro Tzaras --- data/meson.build | 2 +- tests/meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/meson.build b/data/meson.build index a41fdc2..1633d98 100644 --- a/data/meson.build +++ b/data/meson.build @@ -22,7 +22,7 @@ dbus_inc = include_directories('.') install_data(dbus_interfaces, install_dir: ifacedir) schemas = ['org.sigxcpu.feedbackd.gschema.xml'] -compiled = gnome.compile_schemas(depend_files: schemas, build_by_default: true) +compiled_schemas = gnome.compile_schemas(depend_files: schemas, build_by_default: true) compile_schemas = find_program('glib-compile-schemas', required: false) if compile_schemas.found() diff --git a/tests/meson.build b/tests/meson.build index d879153..71e7bd6 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -91,7 +91,7 @@ if get_option('tests') include_directories: fbd_inc, dependencies: test_fbd_deps, ) - test(test, t, env: test_env_fbd) + test(test, t, env: test_env_fbd, depends: compiled_schemas) endforeach endif # daemon