In order to run pam module tests we need to pass the libraries via
LD_PRELOAD, this supports a list of library paths, so use the compiler in
order to find their full paths (with soname) and check their presence.
In order to support linker scripts we need to introduce a workaround.
See meson issue https://github.com/mesonbuild/meson/issues/6880
We run a certain number of tests right now, without being able to easily
run them separated or to check which one failed.
So add a script to inspect all the available unittests per each python
script and use it to figure out the tests we can run in meson.
As per this, define a global 'python_tests' variable in meson that allows
to register new python tests easily without having to repeat the settings
for all the tests.
For each test we have, we check if we can fetch a list of unit tests, and
if possible we create a meson test for each one.
Otherwise we just fallback to normal behavior.
This is something that can be hopefully implemented into upstream meson [1].
[1] https://github.com/mesonbuild/meson/issues/6851