From 3e6e9d87471d289f0ecd5da08dfe8fae62db307c Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Tue, 12 Aug 2025 14:19:07 +0800 Subject: [PATCH] meson: Install test programs Some test systems, such as Fedora need a test package to set up the test environments. Moreover, it allows the distributions to check fprintd working as expected. This work installs the test programs to prefix/libexecdir/installed-tests/installed-tests/fprintd, for example: /usr/libexec/installed-tests/fprintd --- meson_options.txt | 4 ++++ tests/meson.build | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/meson_options.txt b/meson_options.txt index 73b28f2..7a33def 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -32,3 +32,7 @@ option('tests', type: 'boolean', value: true, description: 'Run tests') +option('installed-tests', + type: 'boolean', + value: false, + description: 'Install test programs') diff --git a/tests/meson.build b/tests/meson.build index 9c96e10..f01dec0 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -128,3 +128,34 @@ if not address_sanitizer and find_program('valgrind', required: false).found() ) endif +if get_option('installed-tests') + installed_tests_dir = fprintd_installdir / 'installed-tests' / 'fprintd' + + install_subdir('dbusmock', + install_dir: installed_tests_dir, + ) + + install_subdir('pam', + install_dir: installed_tests_dir, + ) + + install_subdir('prints', + install_dir: installed_tests_dir, + ) + + install_data([ + 'fprintd.py', + 'output_checker.py', + 'test_fprintd_utils.py', + 'unittest_inspector.py', + ], + install_dir: installed_tests_dir, + install_mode: 'rwxr-xr-x', + ) + install_data([ + 'output_checker.py', + ], + install_dir: installed_tests_dir, + ) +endif +