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