diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2023-05-05 14:46:34 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2023-05-09 08:11:10 +0200 |
commit | 0454cf05d38d289474ca65c1917d414b2958f6b5 (patch) | |
tree | b6ea233b071cd7da497d643fc69a0ef2acd6fb6f /meson.build | |
parent | 09ea351b6fce2ac3be19fc8af40828b722cd6dc4 (diff) | |
download | systemd-0454cf05d38d289474ca65c1917d414b2958f6b5.tar.gz |
test: rework how udev-test is invoked
As part of the build, we would populate build/test/sys/ using
sys-script.py, and then udev-test.p[ly] would create a tmpfs instance
on build/test/tmpfs and copy the sys tree to build/test/tmpfs/sys.
Also, we had udev-test.p[ly] which called test-udev. test-udev was
marked as a manual test and installed, but neither udev-test.p[ly] or
sys-script.py were.
test-udev is renamed to udev-rule-runner, which reduces confusion and
frees up the test-udev name. udev-test.py is renamed to test-udev.py.
All three files are now installed.
test-udev.py is modified to internally call sys-script.py to set up the
sys tree. Copying and creating it from scratch should take the same
amount of time. We avoid having a magic directory, everything is now
done underneath a temporary directory.
test-udev.py is now a normal installed test, and run-unit-tests.py will
pick it up. When test-udev.py is invoked from meson, the path to
udev-rule-runner is passed via envvar; when it is invoked via
run-unit-tests.py or directly, it looks for udev-rule-runner in a relative
path.
The goal of this whole change is to let Debian drop the 'udev' test.
It called sys-script.py and udev-test.pl from the source directory and
had to recreate a bunch of the logic. Now test-udev.py will now be called
via 'upstream'.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 224e6251d2..f6c7279fd5 100644 --- a/meson.build +++ b/meson.build @@ -4415,6 +4415,7 @@ foreach test : simple_tests tests += { 'sources' : [test] } endforeach +TESTS = {} foreach test : tests sources = test.get('sources') condition = test.get('condition', '') @@ -4466,6 +4467,8 @@ foreach test : tests suite : suite, is_parallel : test.get('parallel', true)) endif + + TESTS += { name : exe } endforeach exe = executable( @@ -4527,6 +4530,16 @@ if want_tests != 'false' and static_libudev_pic test('test-libudev-static-sym', exe) endif +if want_tests != 'false' + udev_rule_runner = TESTS['udev-rule-runner'].full_path() + + test('test-udev', + test_udev_py, + args : ['-v'], + env : ['UDEV_RULE_RUNNER=@0@'.format(udev_rule_runner)], + timeout : 180) +endif + ############################################################ foreach fuzzer : simple_fuzzers |