dcavalca / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone
Blob Blame History Raw
From 70cbab08c63909a671136ee9600f9818e404646c Mon Sep 17 00:00:00 2001
From: Jan Janssen <medhefgo@web.de>
Date: Tue, 11 Jan 2022 10:21:23 +0100
Subject: [PATCH] meson: Use files() for tests

Not having to provide the full path in the source tree is much
nicer and the produced lists can also be used anywhere in the source
tree.

(cherry picked from commit e1eeebbb11ca0eca5dfd2ce32a928ee5174ea7ff)

Related: #2017035
---
 meson.build                             |   3 +-
 src/analyze/meson.build                 |   6 +-
 src/boot/efi/meson.build                |   2 +-
 src/busctl/meson.build                  |   6 +-
 src/coredump/meson.build                |   6 +-
 src/import/meson.build                  |   6 +-
 src/journal/meson.build                 |  14 +-
 src/libsystemd-network/meson.build      |  22 +-
 src/libsystemd/meson.build              |  70 ++---
 src/libudev/meson.build                 |   2 +-
 src/locale/meson.build                  |   6 +-
 src/login/meson.build                   |   6 +-
 src/machine/meson.build                 |   2 +-
 src/network/meson.build                 |  16 +-
 src/nspawn/meson.build                  |   4 +-
 src/oom/meson.build                     |   6 +-
 src/resolve/meson.build                 |  16 +-
 src/shutdown/meson.build                |   6 +-
 src/test/meson.build                    | 386 ++++++++++++------------
 src/timesync/meson.build                |   2 +-
 src/tmpfiles/meson.build                |   6 +-
 src/udev/meson.build                    |  16 +-
 src/xdg-autostart-generator/meson.build |   6 +-
 23 files changed, 308 insertions(+), 307 deletions(-)

diff --git a/meson.build b/meson.build
index f040eeab99..35ba29aecf 100644
--- a/meson.build
+++ b/meson.build
@@ -3566,7 +3566,8 @@ foreach tuple : tests
         parallel = tuple.length() > 7 ? tuple[7] : true
         timeout = 30
 
-        name = sources[0].split('/')[-1].split('.')[0]
+        # FIXME: Use fs.stem() with meson >= 0.54.0
+        name = '@0@'.format(sources[0]).split('/')[-1].split('.')[0]
         if type.startswith('timeout=')
                 timeout = type.split('=')[1].to_int()
                 type = ''
diff --git a/src/analyze/meson.build b/src/analyze/meson.build
index 492b79069f..fbc4d7e20d 100644
--- a/src/analyze/meson.build
+++ b/src/analyze/meson.build
@@ -13,9 +13,9 @@ systemd_analyze_sources = files('''
 '''.split())
 
 tests += [
-        [['src/analyze/test-verify.c',
-          'src/analyze/analyze-verify.c',
-          'src/analyze/analyze-verify.h'],
+        [files('test-verify.c',
+               'analyze-verify.c',
+               'analyze-verify.h'),
          [libcore,
           libshared],
          [],
diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build
index 4cc43dc00c..16b34f0ac2 100644
--- a/src/boot/efi/meson.build
+++ b/src/boot/efi/meson.build
@@ -352,7 +352,7 @@ endif
 if efi_arch[1] in ['ia32', 'x86_64', 'arm', 'aarch64']
         systemd_boot_sources += files('bcd.c')
         tests += [
-                [['src/boot/efi/test-bcd.c'],
+                [files('test-bcd.c'),
                  [],
                  [libzstd],
                  [],
diff --git a/src/busctl/meson.build b/src/busctl/meson.build
index f463436fab..295dc0926d 100644
--- a/src/busctl/meson.build
+++ b/src/busctl/meson.build
@@ -6,7 +6,7 @@ busctl_sources = files(
         'busctl.c')
 
 tests += [
-        [['src/busctl/test-busctl-introspect.c',
-          'src/busctl/busctl-introspect.c',
-          'src/busctl/busctl-introspect.h']],
+        [files('test-busctl-introspect.c',
+               'busctl-introspect.c',
+               'busctl-introspect.h')],
 ]
diff --git a/src/coredump/meson.build b/src/coredump/meson.build
index b832192c9f..49ea93965b 100644
--- a/src/coredump/meson.build
+++ b/src/coredump/meson.build
@@ -14,8 +14,8 @@ if conf.get('ENABLE_COREDUMP') == 1 and install_sysconfdir_samples
 endif
 
 tests += [
-        [['src/coredump/test-coredump-vacuum.c',
-          'src/coredump/coredump-vacuum.c',
-          'src/coredump/coredump-vacuum.h'],
+        [files('test-coredump-vacuum.c',
+               'coredump-vacuum.c',
+               'coredump-vacuum.h'),
          [], [], [], '', 'manual'],
 ]
diff --git a/src/import/meson.build b/src/import/meson.build
index 23f0858817..7e923072a9 100644
--- a/src/import/meson.build
+++ b/src/import/meson.build
@@ -61,9 +61,9 @@ if conf.get('ENABLE_IMPORTD') == 1
 endif
 
 tests += [
-        [['src/import/test-qcow2.c',
-          'src/import/qcow2-util.c',
-          'src/import/qcow2-util.h'],
+        [files('test-qcow2.c',
+               'qcow2-util.c',
+               'qcow2-util.h'),
          [],
          [libz],
          [], 'HAVE_ZLIB', 'manual'],
diff --git a/src/journal/meson.build b/src/journal/meson.build
index 270592f2ac..b9a63d5e2f 100644
--- a/src/journal/meson.build
+++ b/src/journal/meson.build
@@ -79,7 +79,7 @@ endif
 ############################################################
 
 tests += [
-        [['src/journal/test-journal-syslog.c'],
+        [files('test-journal-syslog.c'),
          [libjournal_core,
           libshared],
          [threads,
@@ -87,30 +87,30 @@ tests += [
           liblz4,
           libselinux]],
 
-        [['src/journal/test-journal-config.c'],
+        [files('test-journal-config.c'),
          [libjournal_core,
           libshared],
          [libxz,
           liblz4,
           libselinux]],
 
-        [['src/journal/test-journal.c'],
+        [files('test-journal.c'),
          [libjournal_core,
           libshared]],
 
-        [['src/journal/test-journal-stream.c'],
+        [files('test-journal-stream.c'),
          [libjournal_core,
           libshared]],
 
-         [['src/journal/test-journal-flush.c'],
+         [files('test-journal-flush.c'),
           [libjournal_core,
            libshared]],
 
-        [['src/journal/test-journal-verify.c'],
+        [files('test-journal-verify.c'),
          [libjournal_core,
           libshared]],
 
-        [['src/journal/test-journal-interleaving.c'],
+        [files('test-journal-interleaving.c'),
          [libjournal_core,
           libshared]],
 ]
diff --git a/src/libsystemd-network/meson.build b/src/libsystemd-network/meson.build
index a7838cdaa1..3923df48ea 100644
--- a/src/libsystemd-network/meson.build
+++ b/src/libsystemd-network/meson.build
@@ -57,49 +57,49 @@ libsystemd_network_includes = [includes, include_directories('.')]
 ############################################################
 
 tests += [
-        [['src/libsystemd-network/test-dhcp-option.c'],
+        [files('test-dhcp-option.c'),
          [libshared,
           libsystemd_network]],
 
-        [['src/libsystemd-network/test-sd-dhcp-lease.c'],
+        [files('test-sd-dhcp-lease.c'),
          [libshared,
           libsystemd_network]],
 
-        [['src/libsystemd-network/test-dhcp-client.c'],
+        [files('test-dhcp-client.c'),
          [libshared,
           libsystemd_network]],
 
-        [['src/libsystemd-network/test-dhcp-server.c'],
+        [files('test-dhcp-server.c'),
          [libshared,
           libsystemd_network]],
 
-        [['src/libsystemd-network/test-ipv4ll.c'],
+        [files('test-ipv4ll.c'),
          [libshared,
           libsystemd_network]],
 
-        [['src/libsystemd-network/test-ipv4ll-manual.c'],
+        [files('test-ipv4ll-manual.c'),
          [libshared,
           libsystemd_network],
          [], [], '', 'manual'],
 
-        [['src/libsystemd-network/test-acd.c'],
+        [files('test-acd.c'),
          [libshared,
           libsystemd_network],
          [], [], '', 'manual'],
 
-        [['src/libsystemd-network/test-ndisc-rs.c'],
+        [files('test-ndisc-rs.c'),
          [libshared,
           libsystemd_network]],
 
-        [['src/libsystemd-network/test-ndisc-ra.c'],
+        [files('test-ndisc-ra.c'),
          [libshared,
           libsystemd_network]],
 
-        [['src/libsystemd-network/test-dhcp6-client.c'],
+        [files('test-dhcp6-client.c'),
          [libshared,
           libsystemd_network]],
 
-        [['src/libsystemd-network/test-lldp-rx.c'],
+        [files('test-lldp-rx.c'),
          [libshared,
           libsystemd_network]],
 ]
diff --git a/src/libsystemd/meson.build b/src/libsystemd/meson.build
index 124393d3e6..42746e560f 100644
--- a/src/libsystemd/meson.build
+++ b/src/libsystemd/meson.build
@@ -190,43 +190,43 @@ custom_target(
 ############################################################
 
 tests += [
-        [['src/libsystemd/sd-journal/test-journal-send.c']],
+        [files('sd-journal/test-journal-send.c')],
 
-        [['src/libsystemd/sd-journal/test-journal-match.c']],
+        [files('sd-journal/test-journal-match.c')],
 
-        [['src/libsystemd/sd-journal/test-journal-enum.c'],
+        [files('sd-journal/test-journal-enum.c'),
          [], [], [], '', 'timeout=360'],
 
-        [['src/libsystemd/sd-journal/test-journal-init.c']],
+        [files('sd-journal/test-journal-init.c')],
 
-        [['src/libsystemd/sd-journal/test-mmap-cache.c']],
+        [files('sd-journal/test-mmap-cache.c')],
 
-        [['src/libsystemd/sd-journal/test-catalog.c']],
+        [files('sd-journal/test-catalog.c')],
 
-        [['src/libsystemd/sd-journal/test-compress.c'],
+        [files('sd-journal/test-compress.c'),
          [],
          [liblz4,
           libzstd,
           libxz]],
 
-        [['src/libsystemd/sd-journal/test-compress-benchmark.c'],
+        [files('sd-journal/test-compress-benchmark.c'),
          [],
          [liblz4,
           libzstd,
           libxz],
          [], '', 'timeout=90'],
 
-        [['src/libsystemd/sd-journal/test-audit-type.c']],
+        [files('sd-journal/test-audit-type.c')],
 ]
 
 ############################################################
 
 tests += [
-        [['src/libsystemd/sd-bus/test-bus-address.c'],
+        [files('sd-bus/test-bus-address.c'),
          [],
          [threads]],
 
-        [['src/libsystemd/sd-bus/test-bus-marshal.c'],
+        [files('sd-bus/test-bus-marshal.c'),
          [],
          [threads,
           libglib,
@@ -234,82 +234,82 @@ tests += [
           libgio,
           libdbus]],
 
-        [['src/libsystemd/sd-bus/test-bus-signature.c'],
+        [files('sd-bus/test-bus-signature.c'),
          [],
          [threads]],
 
-        [['src/libsystemd/sd-bus/test-bus-queue-ref-cycle.c'],
+        [files('sd-bus/test-bus-queue-ref-cycle.c'),
          [],
          [threads]],
 
-        [['src/libsystemd/sd-bus/test-bus-watch-bind.c'],
+        [files('sd-bus/test-bus-watch-bind.c'),
          [],
          [threads],
          [], '', 'timeout=120'],
 
-        [['src/libsystemd/sd-bus/test-bus-chat.c'],
+        [files('sd-bus/test-bus-chat.c'),
          [],
          [threads]],
 
-        [['src/libsystemd/sd-bus/test-bus-cleanup.c'],
+        [files('sd-bus/test-bus-cleanup.c'),
          [],
          [threads,
           libseccomp]],
 
-        [['src/libsystemd/sd-bus/test-bus-track.c'],
+        [files('sd-bus/test-bus-track.c'),
          [],
          [libseccomp]],
 
-        [['src/libsystemd/sd-bus/test-bus-server.c'],
+        [files('sd-bus/test-bus-server.c'),
          [],
          [threads]],
 
-        [['src/libsystemd/sd-bus/test-bus-objects.c'],
+        [files('sd-bus/test-bus-objects.c'),
          [],
          [threads]],
 
-        [['src/libsystemd/sd-bus/test-bus-vtable.c',
-          'src/libsystemd/sd-bus/test-vtable-data.h']],
+        [files('sd-bus/test-bus-vtable.c',
+               'sd-bus/test-vtable-data.h')],
 
-        [['src/libsystemd/sd-bus/test-bus-gvariant.c'],
+        [files('sd-bus/test-bus-gvariant.c'),
          [],
          [libglib,
           libgobject,
           libgio]],
 
-        [['src/libsystemd/sd-bus/test-bus-creds.c']],
+        [files('sd-bus/test-bus-creds.c')],
 
-        [['src/libsystemd/sd-bus/test-bus-match.c']],
+        [files('sd-bus/test-bus-match.c')],
 
-        [['src/libsystemd/sd-bus/test-bus-benchmark.c'],
+        [files('sd-bus/test-bus-benchmark.c'),
          [],
          [threads],
          [], '', 'manual'],
 
-        [['src/libsystemd/sd-bus/test-bus-introspect.c',
-          'src/libsystemd/sd-bus/test-vtable-data.h']],
+        [files('sd-bus/test-bus-introspect.c',
+               'sd-bus/test-vtable-data.h')],
 
-        [['src/libsystemd/sd-event/test-event.c']],
+        [files('sd-event/test-event.c')],
 
-        [['src/libsystemd/sd-netlink/test-netlink.c']],
+        [files('sd-netlink/test-netlink.c')],
 
-        [['src/libsystemd/sd-resolve/test-resolve.c'],
+        [files('sd-resolve/test-resolve.c'),
          [],
          [threads],
          [], '', 'timeout=120'],
 
-        [['src/libsystemd/sd-login/test-login.c']],
+        [files('sd-login/test-login.c')],
 
-        [['src/libsystemd/sd-device/test-sd-device.c']],
+        [files('sd-device/test-sd-device.c')],
 
-        [['src/libsystemd/sd-device/test-device-util.c']],
+        [files('sd-device/test-device-util.c')],
 
-        [['src/libsystemd/sd-device/test-sd-device-monitor.c']],
+        [files('sd-device/test-sd-device-monitor.c')],
 ]
 
 if cxx_cmd != ''
         tests += [
-                [['src/libsystemd/sd-bus/test-bus-vtable-cc.cc']],
+                [files('sd-bus/test-bus-vtable-cc.cc')],
         ]
 endif
 
diff --git a/src/libudev/meson.build b/src/libudev/meson.build
index 77b31a9492..2d51ff7c58 100644
--- a/src/libudev/meson.build
+++ b/src/libudev/meson.build
@@ -45,7 +45,7 @@ custom_target(
 ############################################################
 
 tests += [
-        [['src/libudev/test-libudev.c'],
+        [files('test-libudev.c'),
          [libshared,
           libudev_basic]],
 ]
diff --git a/src/locale/meson.build b/src/locale/meson.build
index a2ff2a9873..0ccf71583d 100644
--- a/src/locale/meson.build
+++ b/src/locale/meson.build
@@ -30,7 +30,7 @@ if conf.get('ENABLE_LOCALED') == 1
 endif
 
 tests += [
-        [['src/locale/test-keymap-util.c',
-          'src/locale/keymap-util.c',
-          'src/locale/keymap-util.h']],
+        [files('test-keymap-util.c',
+               'keymap-util.c',
+               'keymap-util.h')],
 ]
diff --git a/src/login/meson.build b/src/login/meson.build
index a78c2bc2dd..92f491665c 100644
--- a/src/login/meson.build
+++ b/src/login/meson.build
@@ -101,12 +101,12 @@ endif
 ############################################################
 
 tests += [
-        [['src/login/test-login-shared.c']],
+        [files('test-login-shared.c')],
 
-        [['src/login/test-inhibit.c'],
+        [files('test-inhibit.c'),
          [], [], [], '', 'manual'],
 
-        [['src/login/test-login-tables.c'],
+        [files('test-login-tables.c'),
          [liblogind_core,
           libshared],
          [threads]],
diff --git a/src/machine/meson.build b/src/machine/meson.build
index ef858a5988..87e4dde24c 100644
--- a/src/machine/meson.build
+++ b/src/machine/meson.build
@@ -37,7 +37,7 @@ if conf.get('ENABLE_MACHINED') == 1
 endif
 
 tests += [
-        [['src/machine/test-machine-tables.c'],
+        [files('test-machine-tables.c'),
          [libmachine_core,
           libshared],
          [threads]],
diff --git a/src/network/meson.build b/src/network/meson.build
index 5857439c5a..a598701e4f 100644
--- a/src/network/meson.build
+++ b/src/network/meson.build
@@ -277,37 +277,37 @@ fuzzers += [
 ]
 
 tests += [
-        [['src/network/test-networkd-address.c'],
+        [files('test-networkd-address.c'),
          [libnetworkd_core,
           libsystemd_network],
          [],
          network_includes],
 
-        [['src/network/test-networkd-conf.c'],
+        [files('test-networkd-conf.c'),
          [libnetworkd_core,
           libsystemd_network],
          [],
          network_includes],
 
-        [['src/network/test-networkd-util.c'],
+        [files('test-networkd-util.c'),
          [libnetworkd_core,
           libsystemd_network],
          [],
          network_includes],
 
-        [['src/network/test-network.c'],
+        [files('test-network.c'),
          [libnetworkd_core,
           libsystemd_network],
          [threads],
          network_includes],
 
-        [['src/network/test-network-tables.c'],
+        [files('test-network-tables.c'),
          [libnetworkd_core,
           libsystemd_network],
          [threads],
          network_includes],
 
-        [['src/network/generator/test-network-generator.c',
-          'src/network/generator/network-generator.c',
-          'src/network/generator/network-generator.h']],
+        [files('generator/test-network-generator.c',
+               'generator/network-generator.c',
+               'generator/network-generator.h')],
 ]
diff --git a/src/nspawn/meson.build b/src/nspawn/meson.build
index 11ac404e99..3c1a9c6182 100644
--- a/src/nspawn/meson.build
+++ b/src/nspawn/meson.build
@@ -53,12 +53,12 @@ systemd_nspawn_sources = files('nspawn.c')
 ############################################################
 
 tests += [
-        [['src/nspawn/test-nspawn-tables.c'],
+        [files('test-nspawn-tables.c'),
          [libnspawn_core,
           libshared],
          [libseccomp]],
 
-        [['src/nspawn/test-patch-uid.c'],
+        [files('test-patch-uid.c'),
          [libnspawn_core,
           libshared],
          [libacl],
diff --git a/src/oom/meson.build b/src/oom/meson.build
index 4e1c8543c8..da00cbf99e 100644
--- a/src/oom/meson.build
+++ b/src/oom/meson.build
@@ -28,7 +28,7 @@ if conf.get('ENABLE_OOMD') == 1
 endif
 
 tests += [
-        [['src/oom/test-oomd-util.c',
-          'src/oom/oomd-util.c',
-          'src/oom/oomd-util.h']],
+        [files('test-oomd-util.c',
+               'oomd-util.c',
+               'oomd-util.h')],
 ]
diff --git a/src/resolve/meson.build b/src/resolve/meson.build
index 2cdf24b1cb..4de50c3d8e 100644
--- a/src/resolve/meson.build
+++ b/src/resolve/meson.build
@@ -174,40 +174,40 @@ custom_target(
 ############################################################
 
 tests += [
-        [['src/resolve/test-resolve-tables.c'],
+        [files('test-resolve-tables.c'),
          [libsystemd_resolve_core,
           libshared],
          [lib_openssl_or_gcrypt,
           libm]],
 
-        [['src/resolve/test-dns-packet.c'],
+        [files('test-dns-packet.c'),
          [libsystemd_resolve_core,
           libshared],
          [lib_openssl_or_gcrypt,
           libm]],
 
-        [['src/resolve/test-resolved-etc-hosts.c',
-          'src/resolve/resolved-etc-hosts.c',
-          'src/resolve/resolved-etc-hosts.h'],
+        [files('test-resolved-etc-hosts.c',
+               'resolved-etc-hosts.c',
+               'resolved-etc-hosts.h'),
          [libsystemd_resolve_core,
           libshared],
          [lib_openssl_or_gcrypt,
           libm]],
 
-        [['src/resolve/test-resolved-packet.c'],
+        [files('test-resolved-packet.c'),
          [libsystemd_resolve_core,
           libshared],
          [lib_openssl_or_gcrypt,
           libm]],
 
-        [['src/resolve/test-dnssec.c'],
+        [files('test-dnssec.c'),
          [libsystemd_resolve_core,
           libshared],
          [lib_openssl_or_gcrypt,
           libm],
          [], 'HAVE_OPENSSL_OR_GCRYPT'],
 
-        [['src/resolve/test-dnssec-complex.c'],
+        [files('test-dnssec-complex.c'),
          [libsystemd_resolve_core,
           libshared],
          [lib_openssl_or_gcrypt,
diff --git a/src/shutdown/meson.build b/src/shutdown/meson.build
index e1348d95d4..fcc9f9f0ac 100644
--- a/src/shutdown/meson.build
+++ b/src/shutdown/meson.build
@@ -7,9 +7,9 @@ systemd_shutdown_sources = files('''
 '''.split())
 
 tests += [
-        [['src/shutdown/test-umount.c',
-          'src/shutdown/umount.c',
-          'src/shutdown/umount.h'],
+        [files('test-umount.c',
+               'umount.c',
+               'umount.h'),
          [],
          [libmount]],
 ]
diff --git a/src/test/meson.build b/src/test/meson.build
index 48001d17ec..9e224d69ce 100644
--- a/src/test/meson.build
+++ b/src/test/meson.build
@@ -41,11 +41,11 @@ test_dlopen_c = files('test-dlopen.c')
 ############################################################
 
 tests += [
-        [['src/test/test-device-nodes.c']],
+        [files('test-device-nodes.c')],
 
-        [['src/test/test-ether-addr-util.c']],
+        [files('test-ether-addr-util.c')],
 
-        [['src/test/test-engine.c'],
+        [files('test-engine.c'),
          [libcore,
           libshared],
          [threads,
@@ -56,21 +56,21 @@ tests += [
           libblkid],
          core_includes],
 
-        [['src/test/test-emergency-action.c'],
+        [files('test-emergency-action.c'),
          [libcore,
           libshared],
          [],
          core_includes],
 
-        [['src/test/test-chown-rec.c'],
+        [files('test-chown-rec.c'),
          [libcore,
           libshared],
          [],
          core_includes],
 
-        [['src/test/test-dlopen-so.c']],
+        [files('test-dlopen-so.c')],
 
-        [['src/test/test-job-type.c'],
+        [files('test-job-type.c'),
          [libcore,
           libshared],
          [threads,
@@ -81,7 +81,7 @@ tests += [
           libblkid],
          core_includes],
 
-        [['src/test/test-ns.c'],
+        [files('test-ns.c'),
          [libcore,
           libshared],
          [threads,
@@ -92,7 +92,7 @@ tests += [
           libblkid],
          core_includes, '', 'manual'],
 
-        [['src/test/test-loopback.c'],
+        [files('test-loopback.c'),
          [libcore,
           libshared],
          [threads,
@@ -103,14 +103,14 @@ tests += [
           libblkid],
          core_includes],
 
-        [['src/test/test-dns-domain.c']],
+        [files('test-dns-domain.c')],
 
-        [['src/test/test-boot-timestamps.c'],
+        [files('test-boot-timestamps.c'),
          [], [], [], 'ENABLE_EFI'],
 
-        [['src/test/test-unit-file.c']],
+        [files('test-unit-file.c')],
 
-        [['src/test/test-unit-name.c'],
+        [files('test-unit-name.c'),
          [libcore,
           libshared],
          [threads,
@@ -121,7 +121,7 @@ tests += [
           libblkid],
          core_includes],
 
-        [['src/test/test-load-fragment.c'],
+        [files('test-load-fragment.c'),
          [libcore,
           libshared],
          [threads,
@@ -132,9 +132,9 @@ tests += [
           libblkid],
          core_includes],
 
-        [['src/test/test-serialize.c']],
+        [files('test-serialize.c')],
 
-        [['src/test/test-unit-serialize.c'],
+        [files('test-unit-serialize.c'),
          [libcore,
           libshared],
          [threads,
@@ -145,196 +145,196 @@ tests += [
           libblkid],
          core_includes],
 
-        [['src/test/test-utf8.c']],
+        [files('test-utf8.c')],
 
-        [['src/test/test-kbd-util.c']],
+        [files('test-kbd-util.c')],
 
-        [['src/test/test-blockdev-util.c']],
+        [files('test-blockdev-util.c')],
 
-        [['src/test/test-dev-setup.c']],
+        [files('test-dev-setup.c')],
 
-        [['src/test/test-capability.c'],
+        [files('test-capability.c'),
          [],
          [libcap]],
 
-        [['src/test/test-async.c'],
+        [files('test-async.c'),
          [], [], [], '', 'timeout=120'],
 
-        [['src/test/test-locale-util.c']],
+        [files('test-locale-util.c')],
 
-        [['src/test/test-copy.c']],
+        [files('test-copy.c')],
 
-        [['src/test/test-recurse-dir.c']],
+        [files('test-recurse-dir.c')],
 
-        [['src/test/test-data-fd-util.c']],
+        [files('test-data-fd-util.c')],
 
-        [['src/test/test-static-destruct.c']],
+        [files('test-static-destruct.c')],
 
-        [['src/test/test-sigbus.c']],
+        [files('test-sigbus.c')],
 
-        [['src/test/test-condition.c']],
+        [files('test-condition.c')],
 
-        [['src/test/test-fdset.c']],
+        [files('test-fdset.c')],
 
-        [['src/test/test-fstab-util.c']],
+        [files('test-fstab-util.c')],
 
-        [['src/test/test-random-util.c'],
+        [files('test-random-util.c'),
          [],
          [libm],
          [], '', 'timeout=120'],
 
-        [['src/test/test-format-table.c']],
+        [files('test-format-table.c')],
 
-        [['src/test/test-format-util.c']],
+        [files('test-format-util.c')],
 
-        [['src/test/test-ratelimit.c']],
+        [files('test-ratelimit.c')],
 
-        [['src/test/test-util.c']],
+        [files('test-util.c')],
 
-        [['src/test/test-macro.c']],
+        [files('test-macro.c')],
 
-        [['src/test/test-json.c']],
+        [files('test-json.c')],
 
-        [['src/test/test-modhex.c']],
+        [files('test-modhex.c')],
 
-        [['src/test/test-libmount.c'],
+        [files('test-libmount.c'),
          [],
          [threads,
           libmount]],
 
-        [['src/test/test-mount-util.c']],
+        [files('test-mount-util.c')],
 
-        [['src/test/test-mountpoint-util.c']],
+        [files('test-mountpoint-util.c')],
 
-        [['src/test/test-exec-util.c']],
+        [files('test-exec-util.c')],
 
-        [['src/test/test-hexdecoct.c']],
+        [files('test-hexdecoct.c')],
 
-        [['src/test/test-alloc-util.c']],
+        [files('test-alloc-util.c')],
 
-        [['src/test/test-xattr-util.c']],
+        [files('test-xattr-util.c')],
 
-        [['src/test/test-io-util.c']],
+        [files('test-io-util.c')],
 
-        [['src/test/test-glob-util.c']],
+        [files('test-glob-util.c')],
 
-        [['src/test/test-fs-util.c']],
+        [files('test-fs-util.c')],
 
-        [['src/test/test-install-file.c']],
+        [files('test-install-file.c')],
 
-        [['src/test/test-umask-util.c']],
+        [files('test-umask-util.c')],
 
-        [['src/test/test-proc-cmdline.c']],
+        [files('test-proc-cmdline.c')],
 
-        [['src/test/test-fd-util.c'],
+        [files('test-fd-util.c'),
          [],
          [libseccomp]],
 
-        [['src/test/test-web-util.c']],
+        [files('test-web-util.c')],
 
-        [['src/test/test-cpu-set-util.c']],
+        [files('test-cpu-set-util.c')],
 
-        [['src/test/test-stat-util.c']],
+        [files('test-stat-util.c')],
 
-        [['src/test/test-os-util.c']],
+        [files('test-os-util.c')],
 
-        [['src/test/test-libcrypt-util.c'],
+        [files('test-libcrypt-util.c'),
          [], [libcrypt], [], '', 'timeout=120'],
 
-        [['src/test/test-escape.c']],
+        [files('test-escape.c')],
 
-        [['src/test/test-exit-status.c']],
+        [files('test-exit-status.c')],
 
-        [['src/test/test-specifier.c']],
+        [files('test-specifier.c')],
 
-        [['src/test/test-string-util.c']],
+        [files('test-string-util.c')],
 
-        [['src/test/test-extract-word.c']],
+        [files('test-extract-word.c')],
 
-        [['src/test/test-parse-argument.c']],
+        [files('test-parse-argument.c')],
 
-        [['src/test/test-parse-socket-bind-item.c']],
+        [files('test-parse-socket-bind-item.c')],
 
-        [['src/test/test-parse-util.c']],
+        [files('test-parse-util.c')],
 
-        [['src/test/test-sysctl-util.c']],
+        [files('test-sysctl-util.c')],
 
-        [['src/test/test-import-util.c']],
+        [files('test-import-util.c')],
 
-        [['src/test/test-uid-alloc-range.c']],
+        [files('test-uid-alloc-range.c')],
 
-        [['src/test/test-user-util.c']],
+        [files('test-user-util.c')],
 
-        [['src/test/test-hostname-setup.c']],
+        [files('test-hostname-setup.c')],
 
-        [['src/test/test-hostname-util.c']],
+        [files('test-hostname-util.c')],
 
-        [['src/test/test-process-util.c']],
+        [files('test-process-util.c')],
 
-        [['src/test/test-terminal-util.c']],
+        [files('test-terminal-util.c')],
 
-        [['src/test/test-path-lookup.c']],
+        [files('test-path-lookup.c')],
 
-        [['src/test/test-pretty-print.c']],
+        [files('test-pretty-print.c')],
 
-        [['src/test/test-uid-range.c']],
+        [files('test-uid-range.c')],
 
-        [['src/test/test-cap-list.c',
-          generated_gperf_headers],
+        [files('test-cap-list.c') +
+         generated_gperf_headers,
          [],
          [libcap]],
 
-        [['src/test/test-socket-util.c']],
+        [files('test-socket-util.c')],
 
-        [['src/test/test-socket-netlink.c']],
+        [files('test-socket-netlink.c')],
 
-        [['src/test/test-in-addr-util.c']],
+        [files('test-in-addr-util.c')],
 
-        [['src/test/test-in-addr-prefix-util.c']],
+        [files('test-in-addr-prefix-util.c')],
 
-        [['src/test/test-barrier.c']],
+        [files('test-barrier.c')],
 
-        [['src/test/test-tmpfiles.c']],
+        [files('test-tmpfiles.c')],
 
-        [['src/test/test-namespace.c'],
+        [files('test-namespace.c'),
          [libcore,
           libshared],
          [threads,
           libblkid],
          core_includes],
 
-        [['src/test/test-verbs.c']],
+        [files('test-verbs.c')],
 
-        [['src/test/test-install-root.c']],
+        [files('test-install-root.c')],
 
-        [['src/test/test-acl-util.c'],
+        [files('test-acl-util.c'),
          [], [], [], 'HAVE_ACL'],
 
-        [['src/test/test-seccomp.c'],
+        [files('test-seccomp.c'),
          [],
          [libseccomp],
          [], 'HAVE_SECCOMP'],
 
-        [['src/test/test-rlimit-util.c']],
+        [files('test-rlimit-util.c')],
 
-        [['src/test/test-ask-password-api.c'],
+        [files('test-ask-password-api.c'),
          [], [], [], '', 'manual'],
 
-        [['src/test/test-signal-util.c']],
+        [files('test-signal-util.c')],
 
-        [['src/test/test-loop-block.c'],
+        [files('test-loop-block.c'),
          [libcore,
           libshared],
          [threads,
           libblkid],
          core_includes, '', '', [], false],
 
-        [['src/test/test-selinux.c']],
+        [files('test-selinux.c')],
 
-        [['src/test/test-sizeof.c'],
+        [files('test-sizeof.c'),
          [libbasic]],
 
-        [['src/test/test-bpf-devices.c'],
+        [files('test-bpf-devices.c'),
          [libcore,
           libshared],
          [libmount,
@@ -345,7 +345,7 @@ tests += [
           libblkid],
          core_includes],
 
-        [['src/test/test-bpf-firewall.c'],
+        [files('test-bpf-firewall.c'),
          [libcore,
           libshared],
          [libmount,
@@ -356,13 +356,13 @@ tests += [
           libblkid],
          core_includes],
 
-        [['src/test/test-bpf-foreign-programs.c'],
+        [files('test-bpf-foreign-programs.c'),
          [libcore,
           libshared],
          [],
          core_includes],
 
-        [['src/test/test-bpf-lsm.c'],
+        [files('test-bpf-lsm.c'),
          [libcore,
           libshared],
          [libmount,
@@ -373,7 +373,7 @@ tests += [
           libblkid],
          core_includes],
 
-        [['src/test/test-watch-pid.c'],
+        [files('test-watch-pid.c'),
          [libcore,
           libshared],
          [libmount,
@@ -384,32 +384,32 @@ tests += [
           libblkid],
          core_includes],
 
-        [['src/test/test-hashmap.c',
-          'src/test/test-hashmap-plain.c',
-          test_hashmap_ordered_c],
+        [files('test-hashmap.c',
+               'test-hashmap-plain.c') +
+         [test_hashmap_ordered_c],
          [], [], [], '', 'timeout=180'],
 
-        [['src/test/test-set.c']],
+        [files('test-set.c')],
 
-        [['src/test/test-ordered-set.c']],
+        [files('test-ordered-set.c')],
 
-        [['src/test/test-set-disable-mempool.c'],
+        [files('test-set-disable-mempool.c'),
          [],
          [threads]],
 
-        [['src/test/test-hash-funcs.c']],
+        [files('test-hash-funcs.c')],
 
-        [['src/test/test-bitmap.c']],
+        [files('test-bitmap.c')],
 
-        [['src/test/test-xml.c']],
+        [files('test-xml.c')],
 
-        [['src/test/test-list.c']],
+        [files('test-list.c')],
 
-        [['src/test/test-procfs-util.c']],
+        [files('test-procfs-util.c')],
 
-        [['src/test/test-unaligned.c']],
+        [files('test-unaligned.c')],
 
-        [['src/test/test-tables.c'],
+        [files('test-tables.c'),
          [libcore,
           libjournal_core,
           libudevd_core,
@@ -422,70 +422,70 @@ tests += [
           libblkid],
          [core_includes, journal_includes, udev_includes]],
 
-        [['src/test/test-prioq.c']],
+        [files('test-prioq.c')],
 
-        [['src/test/test-fileio.c']],
+        [files('test-fileio.c')],
 
-        [['src/test/test-time-util.c']],
+        [files('test-time-util.c')],
 
-        [['src/test/test-clock.c']],
+        [files('test-clock.c')],
 
-        [['src/test/test-tmpfile-util.c']],
+        [files('test-tmpfile-util.c')],
 
-        [['src/test/test-architecture.c']],
+        [files('test-architecture.c')],
 
-        [['src/test/test-gpt.c']],
+        [files('test-gpt.c')],
 
-        [['src/test/test-log.c']],
+        [files('test-log.c')],
 
-        [['src/test/test-ipcrm.c'],
+        [files('test-ipcrm.c'),
          [], [], [], '', 'unsafe'],
 
-        [['src/test/test-btrfs.c'],
+        [files('test-btrfs.c'),
          [], [], [], '', 'manual'],
 
-        [['src/test/test-firewall-util.c']],
+        [files('test-firewall-util.c')],
 
-        [['src/test/test-net-naming-scheme.c']],
+        [files('test-net-naming-scheme.c')],
 
-        [['src/test/test-netlink-manual.c'],
+        [files('test-netlink-manual.c'),
          [],
          [libkmod],
          [], 'HAVE_KMOD', 'manual'],
 
-        [['src/test/test-ellipsize.c']],
+        [files('test-ellipsize.c')],
 
-        [['src/test/test-date.c']],
+        [files('test-date.c')],
 
-        [['src/test/test-sleep.c']],
+        [files('test-sleep.c')],
 
-        [['src/test/test-tpm2.c']],
+        [files('test-tpm2.c')],
 
-        [['src/test/test-replace-var.c']],
+        [files('test-replace-var.c')],
 
-        [['src/test/test-calendarspec.c']],
+        [files('test-calendarspec.c')],
 
-        [['src/test/test-strip-tab-ansi.c']],
+        [files('test-strip-tab-ansi.c')],
 
-        [['src/test/test-coredump-util.c']],
+        [files('test-coredump-util.c')],
 
-        [['src/test/test-daemon.c']],
+        [files('test-daemon.c')],
 
-        [['src/test/test-cgroup.c']],
+        [files('test-cgroup.c')],
 
-        [['src/test/test-cgroup-cpu.c'],
+        [files('test-cgroup-cpu.c'),
          [libcore,
           libshared],
          [],
          core_includes],
 
-        [['src/test/test-cgroup-unit-default.c'],
+        [files('test-cgroup-unit-default.c'),
          [libcore,
           libshared],
          [],
          core_includes],
 
-        [['src/test/test-cgroup-mask.c'],
+        [files('test-cgroup-mask.c'),
          [libcore,
           libshared],
          [threads,
@@ -496,30 +496,30 @@ tests += [
           libblkid],
          core_includes],
 
-        [['src/test/test-varlink.c'],
+        [files('test-varlink.c'),
          [],
          [threads]],
 
-        [['src/test/test-cgroup-util.c']],
+        [files('test-cgroup-util.c')],
 
-        [['src/test/test-cgroup-setup.c']],
+        [files('test-cgroup-setup.c')],
 
-        [['src/test/test-env-file.c']],
+        [files('test-env-file.c')],
 
-        [['src/test/test-env-util.c']],
+        [files('test-env-util.c')],
 
-        [['src/test/test-strbuf.c']],
+        [files('test-strbuf.c')],
 
-        [['src/test/test-strv.c']],
+        [files('test-strv.c')],
 
-        [['src/test/test-path-util.c']],
+        [files('test-path-util.c')],
 
-        [['src/test/test-rm-rf.c']],
+        [files('test-rm-rf.c')],
 
-        [['src/test/test-chase-symlinks.c'],
+        [files('test-chase-symlinks.c'),
          [], [], [], '', 'manual'],
 
-        [['src/test/test-path.c'],
+        [files('test-path.c'),
          [libcore,
           libshared],
          [threads,
@@ -530,7 +530,7 @@ tests += [
           libblkid],
          core_includes, '', 'timeout=120'],
 
-        [['src/test/test-execute.c'],
+        [files('test-execute.c'),
          [libcore,
           libshared],
          [threads,
@@ -541,20 +541,20 @@ tests += [
           libblkid],
          core_includes, '', 'timeout=360'],
 
-        [['src/test/test-siphash24.c']],
+        [files('test-siphash24.c')],
 
-        [['src/test/test-strxcpyx.c']],
+        [files('test-strxcpyx.c')],
 
-        [['src/test/test-install.c'],
+        [files('test-install.c'),
          [libcore,
           libshared],
          [],
          core_includes, '', 'manual'],
 
-        [['src/test/test-watchdog.c'],
+        [files('test-watchdog.c'),
          [], [], [], '', 'unsafe'],
 
-        [['src/test/test-sched-prio.c'],
+        [files('test-sched-prio.c'),
          [libcore,
           libshared],
          [threads,
@@ -565,25 +565,25 @@ tests += [
           libblkid],
          core_includes],
 
-        [['src/test/test-conf-files.c']],
+        [files('test-conf-files.c')],
 
-        [['src/test/test-conf-parser.c']],
+        [files('test-conf-parser.c')],
 
-        [['src/test/test-af-list.c',
-          generated_gperf_headers]],
+        [files('test-af-list.c') +
+         generated_gperf_headers],
 
-        [['src/test/test-arphrd-util.c',
-          generated_gperf_headers]],
+        [files('test-arphrd-util.c') +
+         generated_gperf_headers],
 
-        [['src/test/test-errno-list.c',
-          generated_gperf_headers]],
+        [files('test-errno-list.c') +
+         generated_gperf_headers],
 
-        [['src/test/test-ip-protocol-list.c',
-          shared_generated_gperf_headers]],
+        [files('test-ip-protocol-list.c') +
+         shared_generated_gperf_headers],
 
-        [['src/test/test-journal-importer.c']],
+        [files('test-journal-importer.c')],
 
-        [['src/test/test-udev.c'],
+        [files('test-udev.c'),
          [libudevd_core,
           libshared],
          [threads,
@@ -594,49 +594,49 @@ tests += [
           libselinux],
          udev_includes, '', 'manual'],
 
-        [['src/test/test-udev-util.c']],
+        [files('test-udev-util.c')],
 
-        [['src/test/test-id128.c']],
+        [files('test-id128.c')],
 
-        [['src/test/test-cryptolib.c'],
+        [files('test-cryptolib.c'),
          [libshared],
          [lib_openssl_or_gcrypt],
          [], 'HAVE_OPENSSL_OR_GCRYPT'],
 
-        [['src/test/test-nss-hosts.c',
-          'src/test/nss-test-util.c',
-          'src/test/nss-test-util.h'],
+        [files('test-nss-hosts.c',
+               'nss-test-util.c',
+               'nss-test-util.h'),
          [],
          [libdl],
          [], 'ENABLE_NSS', 'manual'],
 
-        [['src/test/test-nss-users.c',
-          'src/test/nss-test-util.c',
-          'src/test/nss-test-util.h'],
+        [files('test-nss-users.c',
+               'nss-test-util.c',
+               'nss-test-util.h'),
          [],
          [libdl],
          [], 'ENABLE_NSS', 'manual'],
 
-        [['src/test/test-bus-util.c']],
+        [files('test-bus-util.c')],
 
-        [['src/test/test-percent-util.c']],
+        [files('test-percent-util.c')],
 
-        [['src/test/test-sd-hwdb.c']],
+        [files('test-sd-hwdb.c')],
 
-        [['src/test/test-sd-path.c']],
+        [files('test-sd-path.c')],
 
-        [['src/test/test-local-addresses.c']],
+        [files('test-local-addresses.c')],
 
-        [['src/test/test-psi-util.c']],
+        [files('test-psi-util.c')],
 
-        [['src/test/test-qrcode-util.c'],
+        [files('test-qrcode-util.c'),
          [],
          [libdl]],
 
-        [['src/test/test-nscd-flush.c'],
+        [files('test-nscd-flush.c'),
          [], [], [], 'ENABLE_NSCD', 'manual'],
 
-        [['src/test/test-hmac.c']],
+        [files('test-hmac.c')],
 ]
 
 ############################################################
@@ -644,23 +644,23 @@ tests += [
 # define some tests here, because the link_with deps were not defined earlier
 
 tests += [
-        [['src/libsystemd/sd-bus/test-bus-error.c'],
+        [files('../libsystemd/sd-bus/test-bus-error.c'),
          [libshared_static,
           libsystemd_static]],
 
-        [['src/libsystemd/sd-device/test-sd-device-thread.c'],
+        [files('../libsystemd/sd-device/test-sd-device-thread.c'),
          [libsystemd],
          [threads]],
 
-        [['src/libudev/test-udev-device-thread.c'],
+        [files('../libudev/test-udev-device-thread.c'),
          [libudev],
          [threads]],
 ]
 
 tests += [
-         [['src/test/test-socket-bind.c'],
-          [libcore,
-          libshared],
+        [files('test-socket-bind.c'),
+         [libcore,
+         libshared],
          [libdl],
          core_includes,
          'BPF_FRAMEWORK'],
diff --git a/src/timesync/meson.build b/src/timesync/meson.build
index 83dd7c8f67..8ecfbfab82 100644
--- a/src/timesync/meson.build
+++ b/src/timesync/meson.build
@@ -55,7 +55,7 @@ endif
 ############################################################
 
 tests += [
-        [['src/timesync/test-timesync.c'],
+        [files('test-timesync.c'),
          [libtimesyncd_core,
           libshared],
          [libm]],
diff --git a/src/tmpfiles/meson.build b/src/tmpfiles/meson.build
index c72b386cda..cfa3d370a7 100644
--- a/src/tmpfiles/meson.build
+++ b/src/tmpfiles/meson.build
@@ -6,7 +6,7 @@ systemd_tmpfiles_sources = files(
         'offline-passwd.h')
 
 tests += [
-        [['src/tmpfiles/test-offline-passwd.c',
-          'src/tmpfiles/offline-passwd.c',
-          'src/tmpfiles/offline-passwd.h']],
+        [files('test-offline-passwd.c',
+               'offline-passwd.c',
+               'offline-passwd.h')],
 ]
diff --git a/src/udev/meson.build b/src/udev/meson.build
index 29ac85da12..57fbf8c8fc 100644
--- a/src/udev/meson.build
+++ b/src/udev/meson.build
@@ -195,28 +195,28 @@ fuzzers += [
 ]
 
 tests += [
-        [['src/udev/test-udev-event.c'],
+        [files('test-udev-event.c'),
          [libudevd_core,
           libshared],
          [threads,
           libacl]],
 
-        [['src/udev/test-udev-node.c'],
+        [files('test-udev-node.c'),
          [libudevd_core,
           libshared],
          [threads,
           libacl]],
 
-        [['src/udev/test-udev-builtin.c'],
+        [files('test-udev-builtin.c'),
          [libudevd_core,
           libshared],
          [threads,
           libacl]],
 
-        [['src/udev/test-udev-netlink.c',
-          'src/udev/udev-netlink.c',
-          'src/udev/udev-netlink.h']],
+        [files('test-udev-netlink.c',
+               'udev-netlink.c',
+               'udev-netlink.h')],
 
-        [['src/udev/fido_id/test-fido-id-desc.c',
-          'src/udev/fido_id/fido_id_desc.c']],
+        [files('fido_id/test-fido-id-desc.c',
+               'fido_id/fido_id_desc.c')],
 ]
diff --git a/src/xdg-autostart-generator/meson.build b/src/xdg-autostart-generator/meson.build
index aa722f7f3c..6418f57c40 100644
--- a/src/xdg-autostart-generator/meson.build
+++ b/src/xdg-autostart-generator/meson.build
@@ -6,9 +6,9 @@ systemd_xdg_autostart_generator_sources = files(
         'xdg-autostart-service.h')
 
 tests += [
-        [['src/xdg-autostart-generator/test-xdg-autostart.c',
-          'src/xdg-autostart-generator/xdg-autostart-service.c',
-          'src/xdg-autostart-generator/xdg-autostart-service.h']],
+        [files('test-xdg-autostart.c',
+               'xdg-autostart-service.c',
+               'xdg-autostart-service.h')],
 ]
 
 fuzzers += [