]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Add simple_tests list
authorJan Janssen <medhefgo@web.de>
Fri, 27 Jan 2023 11:57:35 +0000 (12:57 +0100)
committerJan Janssen <medhefgo@web.de>
Tue, 21 Feb 2023 14:10:26 +0000 (15:10 +0100)
A lot of tests can be defined by just their filename. Moving into their
own list keeps things simpler, especially with the next commit. It also
makes it easier to keep the lists sorted.

meson.build
src/libsystemd/meson.build
src/login/meson.build
src/test/meson.build

index 319246c6393eb3144454ca9cd7d20e88898b83db..8a397e7c4d76389c6719056937377872c970aaeb 100644 (file)
@@ -1936,6 +1936,7 @@ conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', slow_tests)
 ############################################################
 
 tests = []
+simple_tests = []
 fuzzers = []
 catalogs = []
 
@@ -4076,6 +4077,10 @@ if '-O2' in c_args and '-flto=auto' in c_args
         test_cflags += cc.first_supported_argument('-Wno-maybe-uninitialized')
 endif
 
+foreach test : simple_tests
+        tests += [ [[test]] ]
+endforeach
+
 foreach tuple : tests
         sources = tuple[0]
         link_with = tuple.length() > 1 and tuple[1].length() > 0 ? tuple[1] : [libshared]
index e2eb88f9fd49e5ea252e32d4c80e90d31d48ec6b..8646da50a164e4fc9f0317f7328ac6e55506dbe8 100644 (file)
@@ -142,27 +142,36 @@ libsystemd_pc = custom_target(
 
 ############################################################
 
-tests += [
-        [files('sd-journal/test-journal-file.c')],
-
-        [files('sd-journal/test-journal-send.c')],
-
-        [files('sd-journal/test-journal-match.c')],
+simple_tests += files(
+        'sd-journal/test-audit-type.c',
+        'sd-journal/test-catalog.c',
+        'sd-journal/test-journal-file.c',
+        'sd-journal/test-journal-init.c',
+        'sd-journal/test-journal-match.c',
+        'sd-journal/test-journal-send.c',
+        'sd-journal/test-mmap-cache.c',
+)
 
+tests += [
         [files('sd-journal/test-journal-enum.c'),
          [], [], [], '', 'timeout=360'],
-
-        [files('sd-journal/test-journal-init.c')],
-
-        [files('sd-journal/test-mmap-cache.c')],
-
-        [files('sd-journal/test-catalog.c')],
-
-        [files('sd-journal/test-audit-type.c')],
 ]
 
 ############################################################
 
+simple_tests += files(
+        'sd-bus/test-bus-creds.c',
+        'sd-bus/test-bus-introspect.c',
+        'sd-bus/test-bus-match.c',
+        'sd-bus/test-bus-vtable.c',
+        'sd-device/test-device-util.c',
+        'sd-device/test-sd-device-monitor.c',
+        'sd-device/test-sd-device.c',
+        'sd-event/test-event.c',
+        'sd-login/test-login.c',
+        'sd-netlink/test-netlink.c',
+)
+
 tests += [
         [files('sd-bus/test-bus-address.c'),
          [],
@@ -211,41 +220,19 @@ tests += [
          [],
          [threads]],
 
-        [files('sd-bus/test-bus-vtable.c')],
-
-        [files('sd-bus/test-bus-creds.c')],
-
-        [files('sd-bus/test-bus-match.c')],
-
         [files('sd-bus/test-bus-benchmark.c'),
          [],
          [threads],
          [], '', 'manual'],
 
-        [files('sd-bus/test-bus-introspect.c')],
-
-        [files('sd-event/test-event.c')],
-
-        [files('sd-netlink/test-netlink.c')],
-
         [files('sd-resolve/test-resolve.c'),
          [],
          [threads],
          [], '', 'timeout=120'],
-
-        [files('sd-login/test-login.c')],
-
-        [files('sd-device/test-sd-device.c')],
-
-        [files('sd-device/test-device-util.c')],
-
-        [files('sd-device/test-sd-device-monitor.c')],
 ]
 
 if cxx_cmd != ''
-        tests += [
-                [files('sd-bus/test-bus-vtable-cc.cc')],
-        ]
+        simple_tests += files('sd-bus/test-bus-vtable-cc.cc')
 endif
 
 ############################################################
index c93a2fd4c653029e0767085a62ea66ebd815f6fd..fd153d4ef819e2b44833acc4a20d510a540ce0c2 100644 (file)
@@ -77,9 +77,11 @@ endif
 
 ############################################################
 
-tests += [
-        [files('test-login-shared.c')],
+simple_tests += files(
+        'test-login-shared.c'
+)
 
+tests += [
         [files('test-inhibit.c'),
          [], [], [], '', 'manual'],
 
index 1dbe12dc406fe737f023712de253b2971be7be82..4274aad2225c8a6e008906b8bccaa08561be8f1d 100644 (file)
@@ -39,13 +39,144 @@ test_dlopen_c = files('test-dlopen.c')
 
 ############################################################
 
-tests += [
-        [files('test-argv-util.c')],
-
-        [files('test-device-nodes.c')],
+simple_tests += files(
+        'test-alloc-util.c',
+        'test-architecture.c',
+        'test-argv-util.c',
+        'test-barrier.c',
+        'test-bitmap.c',
+        'test-blockdev-util.c',
+        'test-bootspec.c',
+        'test-bus-util.c',
+        'test-calendarspec.c',
+        'test-cgroup-setup.c',
+        'test-cgroup-util.c',
+        'test-cgroup.c',
+        'test-clock.c',
+        'test-condition.c',
+        'test-conf-files.c',
+        'test-conf-parser.c',
+        'test-copy.c',
+        'test-coredump-util.c',
+        'test-cpu-set-util.c',
+        'test-creds.c',
+        'test-daemon.c',
+        'test-data-fd-util.c',
+        'test-date.c',
+        'test-dev-setup.c',
+        'test-device-nodes.c',
+        'test-devnum-util.c',
+        'test-dns-domain.c',
+        'test-ellipsize.c',
+        'test-env-file.c',
+        'test-env-util.c',
+        'test-errno-util.c',
+        'test-escape.c',
+        'test-ether-addr-util.c',
+        'test-exec-util.c',
+        'test-execve.c',
+        'test-exit-status.c',
+        'test-extract-word.c',
+        'test-fdset.c',
+        'test-fileio.c',
+        'test-firewall-util.c',
+        'test-format-table.c',
+        'test-format-util.c',
+        'test-fs-util.c',
+        'test-fstab-util.c',
+        'test-glob-util.c',
+        'test-gpt.c',
+        'test-hash-funcs.c',
+        'test-hexdecoct.c',
+        'test-hmac.c',
+        'test-hostname-setup.c',
+        'test-hostname-util.c',
+        'test-id128.c',
+        'test-import-util.c',
+        'test-in-addr-prefix-util.c',
+        'test-in-addr-util.c',
+        'test-install-file.c',
+        'test-install-root.c',
+        'test-io-util.c',
+        'test-journal-importer.c',
+        'test-kbd-util.c',
+        'test-limits-util.c',
+        'test-list.c',
+        'test-local-addresses.c',
+        'test-locale-util.c',
+        'test-log.c',
+        'test-logarithm.c',
+        'test-macro.c',
+        'test-memory-util.c',
+        'test-mempool.c',
+        'test-mkdir.c',
+        'test-modhex.c',
+        'test-mount-util.c',
+        'test-mountpoint-util.c',
+        'test-net-naming-scheme.c',
+        'test-nulstr-util.c',
+        'test-open-file.c',
+        'test-ordered-set.c',
+        'test-os-util.c',
+        'test-parse-argument.c',
+        'test-parse-helpers.c',
+        'test-path-lookup.c',
+        'test-path-util.c',
+        'test-percent-util.c',
+        'test-pretty-print.c',
+        'test-prioq.c',
+        'test-proc-cmdline.c',
+        'test-procfs-util.c',
+        'test-psi-util.c',
+        'test-ratelimit.c',
+        'test-raw-clone.c',
+        'test-recurse-dir.c',
+        'test-replace-var.c',
+        'test-rlimit-util.c',
+        'test-rm-rf.c',
+        'test-sd-hwdb.c',
+        'test-sd-path.c',
+        'test-selinux.c',
+        'test-serialize.c',
+        'test-set.c',
+        'test-sha256.c',
+        'test-sigbus.c',
+        'test-signal-util.c',
+        'test-siphash24.c',
+        'test-sleep.c',
+        'test-socket-netlink.c',
+        'test-socket-util.c',
+        'test-specifier.c',
+        'test-stat-util.c',
+        'test-static-destruct.c',
+        'test-strbuf.c',
+        'test-string-util.c',
+        'test-strip-tab-ansi.c',
+        'test-strv.c',
+        'test-strxcpyx.c',
+        'test-sysctl-util.c',
+        'test-terminal-util.c',
+        'test-time-util.c',
+        'test-tmpfile-util.c',
+        'test-tmpfiles.c',
+        'test-tpm2.c',
+        'test-udev-util.c',
+        'test-uid-alloc-range.c',
+        'test-uid-range.c',
+        'test-umask-util.c',
+        'test-unaligned.c',
+        'test-unit-file.c',
+        'test-user-util.c',
+        'test-utf8.c',
+        'test-verbs.c',
+        'test-web-util.c',
+        'test-xattr-util.c',
+        'test-xml.c',
+)
 
-        [files('test-ether-addr-util.c')],
+############################################################
 
+tests += [
         [files('test-engine.c'),
          [libcore,
           libshared],
@@ -112,13 +243,9 @@ tests += [
           libblkid],
          core_includes],
 
-        [files('test-dns-domain.c')],
-
         [files('test-boot-timestamps.c'),
          [], [], [], 'ENABLE_EFI'],
 
-        [files('test-unit-file.c')],
-
         [files('test-unit-name.c'),
          [libcore,
           libshared],
@@ -141,8 +268,6 @@ tests += [
           libblkid],
          core_includes],
 
-        [files('test-serialize.c')],
-
         [files('test-unit-serialize.c'),
          [libcore,
           libshared],
@@ -154,14 +279,6 @@ tests += [
           libblkid],
          core_includes],
 
-        [files('test-utf8.c')],
-
-        [files('test-kbd-util.c')],
-
-        [files('test-blockdev-util.c')],
-
-        [files('test-dev-setup.c')],
-
         [files('test-capability.c'),
          [],
          [libcap]],
@@ -169,12 +286,6 @@ tests += [
         [files('test-async.c'),
          [], [], [], '', 'timeout=120'],
 
-        [files('test-locale-util.c')],
-
-        [files('test-copy.c')],
-
-        [files('test-recurse-dir.c')],
-
         [files('test-compress.c'),
          [libshared,
           libbasic_compress]],
@@ -185,160 +296,44 @@ tests += [
          [],
          [], '', 'timeout=90'],
 
-        [files('test-data-fd-util.c')],
-
-        [files('test-static-destruct.c')],
-
-        [files('test-sigbus.c')],
-
-        [files('test-condition.c')],
-
-        [files('test-fdset.c')],
-
-        [files('test-fstab-util.c')],
-
         [files('test-random-util.c'),
          [],
          [libm],
          [], '', 'timeout=120'],
 
-        [files('test-format-table.c')],
-
-        [files('test-format-util.c')],
-
-        [files('test-ratelimit.c')],
-
-        [files('test-raw-clone.c')],
-
-        [files('test-limits-util.c')],
-
-        [files('test-logarithm.c')],
-
-        [files('test-macro.c')],
-
         [files('test-math-util.c'),
          [],
          [libm]],
 
-        [files('test-memory-util.c')],
-
-        [files('test-mkdir.c')],
-
         [files('test-json.c'),
          [],
          [libm]],
 
-        [files('test-modhex.c')],
-
         [files('test-libmount.c'),
          [],
          [threads,
           libmount]],
 
-        [files('test-mount-util.c')],
-
-        [files('test-mountpoint-util.c')],
-
-        [files('test-exec-util.c')],
-
-        [files('test-execve.c')],
-
-        [files('test-hexdecoct.c')],
-
-        [files('test-alloc-util.c')],
-
-        [files('test-xattr-util.c')],
-
-        [files('test-io-util.c')],
-
-        [files('test-glob-util.c')],
-
-        [files('test-fs-util.c')],
-
-        [files('test-install-file.c')],
-
-        [files('test-umask-util.c')],
-
-        [files('test-creds.c')],
-
-        [files('test-proc-cmdline.c')],
-
         [files('test-fd-util.c'),
          [],
          [libseccomp]],
 
-        [files('test-web-util.c')],
-
-        [files('test-cpu-set-util.c')],
-
-        [files('test-stat-util.c')],
-
-        [files('test-devnum-util.c')],
-
-        [files('test-os-util.c')],
-
         [files('test-libcrypt-util.c'),
          [], [libcrypt], [], '', 'timeout=120'],
 
-        [files('test-escape.c')],
-
-        [files('test-exit-status.c')],
-
-        [files('test-specifier.c')],
-
-        [files('test-string-util.c')],
-
-        [files('test-extract-word.c')],
-
-        [files('test-parse-argument.c')],
-
-        [files('test-parse-helpers.c')],
-
         [files('test-parse-util.c'),
          [],
          [libm]],
 
-        [files('test-sysctl-util.c')],
-
-        [files('test-import-util.c')],
-
-        [files('test-uid-alloc-range.c')],
-
-        [files('test-user-util.c')],
-
-        [files('test-hostname-setup.c')],
-
-        [files('test-hostname-util.c')],
-
         [files('test-process-util.c'),
          [],
          [threads]],
 
-        [files('test-terminal-util.c')],
-
-        [files('test-path-lookup.c')],
-
-        [files('test-pretty-print.c')],
-
-        [files('test-uid-range.c')],
-
         [files('test-cap-list.c') +
          generated_gperf_headers,
          [],
          [libcap]],
 
-        [files('test-socket-util.c')],
-
-        [files('test-socket-netlink.c')],
-
-        [files('test-in-addr-util.c')],
-
-        [files('test-in-addr-prefix-util.c')],
-
-        [files('test-barrier.c')],
-
-        [files('test-tmpfiles.c')],
-
         [files('test-namespace.c'),
          [libcore,
           libshared],
@@ -346,10 +341,6 @@ tests += [
           libblkid],
          core_includes],
 
-        [files('test-verbs.c')],
-
-        [files('test-install-root.c')],
-
         [files('test-acl-util.c'),
          [], [], [], 'HAVE_ACL'],
 
@@ -358,13 +349,9 @@ tests += [
          [libseccomp],
          [], 'HAVE_SECCOMP'],
 
-        [files('test-rlimit-util.c')],
-
         [files('test-ask-password-api.c'),
          [], [], [], '', 'manual'],
 
-        [files('test-signal-util.c')],
-
         [files('test-loop-block.c'),
          [libcore,
           libshared],
@@ -372,8 +359,6 @@ tests += [
           libblkid],
          core_includes, '', '', [], false],
 
-        [files('test-selinux.c')],
-
         [files('test-sizeof.c'),
          [libbasic]],
 
@@ -432,26 +417,10 @@ tests += [
          [test_hashmap_ordered_c],
          [], [], [], '', 'timeout=180'],
 
-        [files('test-set.c')],
-
-        [files('test-ordered-set.c')],
-
         [files('test-set-disable-mempool.c'),
          [],
          [threads]],
 
-        [files('test-hash-funcs.c')],
-
-        [files('test-bitmap.c')],
-
-        [files('test-xml.c')],
-
-        [files('test-list.c')],
-
-        [files('test-procfs-util.c')],
-
-        [files('test-unaligned.c')],
-
         [files('test-tables.c'),
          [libcore,
           libjournal_core,
@@ -466,63 +435,21 @@ tests += [
           libselinux],
          [core_includes, journal_includes, udev_includes]],
 
-        [files('test-prioq.c')],
-
-        [files('test-fileio.c')],
-
-        [files('test-time-util.c')],
-
-        [files('test-clock.c')],
-
-        [files('test-tmpfile-util.c')],
-
-        [files('test-architecture.c')],
-
-        [files('test-gpt.c')],
-
-        [files('test-log.c')],
-
         [files('test-ipcrm.c'),
          [], [], [], '', 'unsafe'],
 
         [files('test-btrfs.c'),
          [], [], [], '', 'manual'],
 
-        [files('test-firewall-util.c')],
-
-        [files('test-net-naming-scheme.c')],
-
         [files('test-netlink-manual.c'),
          [],
          [libkmod],
          [], 'HAVE_KMOD', 'manual'],
 
-        [files('test-ellipsize.c')],
-
-        [files('test-date.c')],
-
         [files('test-sbat.c'),
          [], [], [], 'HAVE_GNU_EFI', '',
          ['-I@0@'.format(efi_config_h_dir)]],
 
-        [files('test-sleep.c')],
-
-        [files('test-tpm2.c')],
-
-        [files('test-mempool.c')],
-
-        [files('test-replace-var.c')],
-
-        [files('test-calendarspec.c')],
-
-        [files('test-strip-tab-ansi.c')],
-
-        [files('test-coredump-util.c')],
-
-        [files('test-daemon.c')],
-
-        [files('test-cgroup.c')],
-
         [files('test-cgroup-cpu.c'),
          [libcore,
           libshared],
@@ -550,26 +477,6 @@ tests += [
          [],
          [threads]],
 
-        [files('test-cgroup-util.c')],
-
-        [files('test-cgroup-setup.c')],
-
-        [files('test-env-file.c')],
-
-        [files('test-env-util.c')],
-
-        [files('test-strbuf.c')],
-
-        [files('test-bootspec.c')],
-
-        [files('test-strv.c')],
-
-        [files('test-nulstr-util.c')],
-
-        [files('test-path-util.c')],
-
-        [files('test-rm-rf.c')],
-
         [files('test-chase-symlinks.c'),
          [], [], [], '', 'manual'],
 
@@ -595,10 +502,6 @@ tests += [
           libblkid],
          core_includes, '', 'timeout=360'],
 
-        [files('test-siphash24.c')],
-
-        [files('test-strxcpyx.c')],
-
         [files('test-install.c'),
          [libcore,
           libshared],
@@ -619,10 +522,6 @@ tests += [
           libblkid],
          core_includes],
 
-        [files('test-conf-files.c')],
-
-        [files('test-conf-parser.c')],
-
         [files('test-af-list.c') +
          generated_gperf_headers],
 
@@ -632,13 +531,9 @@ tests += [
         [files('test-errno-list.c') +
          generated_gperf_headers],
 
-        [files('test-errno-util.c')],
-
         [files('test-ip-protocol-list.c') +
          shared_generated_gperf_headers],
 
-        [files('test-journal-importer.c')],
-
         [files('test-utmp.c'),
          [], [], [], 'ENABLE_UTMP'],
 
@@ -653,10 +548,6 @@ tests += [
           libselinux],
          udev_includes, '', 'manual'],
 
-        [files('test-udev-util.c')],
-
-        [files('test-id128.c')],
-
         [files('test-cryptolib.c'),
          [libshared],
          [lib_openssl_or_gcrypt],
@@ -674,30 +565,12 @@ tests += [
          [libdl],
          [], 'ENABLE_NSS'],
 
-        [files('test-bus-util.c')],
-
-        [files('test-percent-util.c')],
-
-        [files('test-sd-hwdb.c')],
-
-        [files('test-sd-path.c')],
-
-        [files('test-local-addresses.c')],
-
-        [files('test-psi-util.c')],
-
         [files('test-qrcode-util.c'),
          [],
          [libdl]],
 
         [files('test-nscd-flush.c'),
          [], [], [], 'ENABLE_NSCD', 'manual'],
-
-        [files('test-hmac.c')],
-
-        [files('test-sha256.c')],
-
-        [files('test-open-file.c')],
 ]
 
 ############################################################