From: Franck Bui Date: Fri, 17 Mar 2023 13:18:50 +0000 (+0100) Subject: meson: make sure the unit test scripts find testdata/ even if they are not installed... X-Git-Tag: v254-rc1~914^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c18cc7f7fb83b42b12db04d0a1ed4466402ae85b;p=thirdparty%2Fsystemd.git meson: make sure the unit test scripts find testdata/ even if they are not installed in the same directory testdata/ is shared by both the unit tests and the integration tests. Hence it makes sense to place them right under /usr/lib/systemd/tests/ while the tests themself are located under dedicated sub-directories: /usr/lib/systemd/tests/ ├── integration-tests ├── testdata └── unit-tests ├── testdata -> ../testdata However the unit tests implemented as shell scripts (such as test-fstab-generator.sh) expect to find testdata/ where the scripts are installed, ie they do something like: src="$(dirname "$0")/testdata/test-fstab-generator" This patch installs a symlink in 'unitestsdir' named "testdata" and that points to whatever value 'testdata_dir' is set. --- diff --git a/test/meson.build b/test/meson.build index a05b6672088..80a83813cb4 100644 --- a/test/meson.build +++ b/test/meson.build @@ -57,6 +57,12 @@ if install_tests install_data('create-busybox-container', install_mode : 'rwxr-xr-x', install_dir : testdata_dir) + + # The unit tests implemented as shell scripts expect to find testdata/ + # in the directory where they are stored. + meson.add_install_script(meson_make_symlink, + testdata_dir, + unittestsdir / 'testdata') endif test_bootctl_json_sh = find_program('test-bootctl-json.sh')