1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-25 21:57:32 +03:00

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.
This commit is contained in:
Franck Bui 2023-03-17 14:18:50 +01:00
parent 539ee7ab11
commit c18cc7f7fb

View File

@ -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')