1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-29 21:55:36 +03:00

Merge pull request #26203 from medhefgo/meson

meson: Use dicts for test/fuzzer definitions
This commit is contained in:
Yu Watanabe 2023-02-22 10:27:16 +09:00 committed by GitHub
commit 4788f635e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 1223 additions and 1238 deletions

View File

@ -1936,7 +1936,9 @@ conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', slow_tests)
############################################################
tests = []
simple_tests = []
fuzzers = []
simple_fuzzers = []
catalogs = []
############################################################
@ -4076,57 +4078,51 @@ if '-O2' in c_args and '-flto=auto' in c_args
test_cflags += cc.first_supported_argument('-Wno-maybe-uninitialized')
endif
foreach tuple : tests
sources = tuple[0]
link_with = tuple.length() > 1 and tuple[1].length() > 0 ? tuple[1] : [libshared]
dependencies = tuple.length() > 2 ? tuple[2] : []
incs = tuple.length() > 3 and tuple[3].length() > 0 ? tuple[3] : includes
condition = tuple.length() > 4 ? tuple[4] : ''
type = tuple.length() > 5 ? tuple[5] : ''
defs = tuple.length() > 6 ? tuple[6] : []
defs += test_cflags
parallel = tuple.length() > 7 ? tuple[7] : true
timeout = 30
foreach test : simple_tests
tests += { 'sources' : [test] }
endforeach
foreach test : tests
sources = test.get('sources')
condition = test.get('condition', '')
type = test.get('type', '')
base = test.get('base', {})
# 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 = ''
endif
suite = fs.name(fs.parent('@0@'.format(sources[0])))
# FIXME: Use str.replace() with meson >= 0.58.0
suite = suite.split('sd-')[-1]
if condition == '' or conf.get(condition) == 1
exe = executable(
name,
sources,
include_directories : incs,
link_with : link_with,
dependencies : [versiondep,
dependencies],
c_args : defs,
build_by_default : want_tests != 'false',
install_rpath : rootpkglibdir,
install : install_tests,
install_dir : testsdir / type,
link_depends : runtest_env)
if type == 'manual'
message('@0@ is a manual test'.format(name))
elif type == 'unsafe' and want_tests != 'unsafe'
message('@0@ is an unsafe test'.format(name))
elif want_tests != 'false'
test(name, exe,
env : test_env,
timeout : timeout,
suite : suite,
is_parallel : parallel)
endif
else
if condition != '' and conf.get(condition) == 0
message('Not compiling @0@ because @1@ is not true'.format(name, condition))
continue
endif
exe = executable(
name,
sources,
include_directories : [base.get('includes', []), test.get('includes', includes)],
link_with : [base.get('link_with', []), test.get('link_with', libshared)],
dependencies : [versiondep, base.get('dependencies', []), test.get('dependencies', [])],
c_args : [test_cflags, test.get('c_args', [])],
build_by_default : want_tests != 'false',
install_rpath : rootpkglibdir,
install : install_tests,
install_dir : testsdir / type,
link_depends : runtest_env)
if type == 'manual'
message('@0@ is a manual test'.format(name))
elif type == 'unsafe' and want_tests != 'unsafe'
message('@0@ is an unsafe test'.format(name))
elif want_tests != 'false'
test(name, exe,
env : test_env,
timeout : test.get('timeout', 30),
suite : suite,
is_parallel : test.get('parallel', true))
endif
endforeach
@ -4184,14 +4180,16 @@ endif
############################################################
foreach fuzzer : simple_fuzzers
fuzzers += { 'sources' : [fuzzer] }
endforeach
fuzzer_exes = []
foreach tuple : fuzzers
sources = tuple[0]
link_with = tuple.length() > 1 and tuple[1].length() > 0 ? tuple[1] : [libshared]
dependencies = tuple.length() > 2 ? tuple[2] : []
incs = tuple.length() > 3 and tuple[3].length() > 0 ? tuple[3] : includes
defs = tuple.length() > 4 ? tuple[4] : []
foreach fuzzer : fuzzers
sources = fuzzer.get('sources')
base = fuzzer.get('base', {})
dependencies = [base.get('dependencies', []), fuzzer.get('dependencies', [])]
link_args = []
if want_ossfuzz
@ -4203,7 +4201,7 @@ foreach tuple : fuzzers
link_args += ['-fsanitize=fuzzer']
endif
else
sources += 'src/fuzz/fuzz-main.c'
sources += files('src/fuzz/fuzz-main.c')
endif
sources += fuzz_generated_directives
@ -4213,11 +4211,14 @@ foreach tuple : fuzzers
exe = executable(
name,
sources,
include_directories : [incs, include_directories('src/fuzz')],
link_with : link_with,
dependencies : [dependencies,
versiondep],
c_args : defs + test_cflags,
include_directories : [
base.get('includes', []),
fuzzer.get('includes', includes),
include_directories('src/fuzz'),
],
link_with : [base.get('link_with', []), fuzzer.get('link_with', libshared)],
dependencies : [dependencies, versiondep],
c_args : [test_cflags, fuzzer.get('c_args', [])],
link_args: link_args,
install : false,
build_by_default : fuzzer_build)

View File

@ -30,11 +30,11 @@ systemd_analyze_sources = files(
)
tests += [
[files('test-verify.c',
'analyze-verify-util.c',
'analyze-verify-util.h'),
[libcore,
libshared],
[],
core_includes],
{
'sources' : files(
'test-verify.c',
'analyze-verify-util.c',
),
'base' : test_core_base,
},
]

View File

@ -401,23 +401,47 @@ if efi_arch[1] in ['ia32', 'x86_64']
endif
tests += [
[files('test-efi-string.c', 'efi-string.c')],
{
'sources' : files(
'test-efi-string.c',
'efi-string.c',
)
},
]
# BCD parser only makes sense on arches that Windows supports.
if efi_arch[1] in ['ia32', 'x86_64', 'arm', 'aarch64']
systemd_boot_sources += files('bcd.c')
tests += [
[files('test-bcd.c', 'efi-string.c'),
[],
[libzstd],
[],
'HAVE_ZSTD'],
{
'sources' : files(
'test-bcd.c',
'efi-string.c',
),
'dependencies' : libzstd,
'condition' : 'HAVE_ZSTD',
},
]
fuzzers += [
[files('fuzz-bcd.c', 'bcd.c', 'efi-string.c')],
[files('fuzz-efi-string.c', 'efi-string.c')],
[files('fuzz-efi-printf.c', 'efi-string.c')],
{
'sources' : files(
'fuzz-bcd.c',
'bcd.c',
'efi-string.c'
),
},
{
'sources' : files(
'fuzz-efi-string.c',
'efi-string.c'
),
},
{
'sources' : files(
'fuzz-efi-printf.c',
'efi-string.c'
),
},
]
endif

View File

@ -6,6 +6,10 @@ busctl_sources = files(
)
tests += [
[files('test-busctl-introspect.c',
'busctl-introspect.c')],
{
'sources' : files(
'test-busctl-introspect.c',
'busctl-introspect.c',
)
},
]

View File

@ -179,9 +179,18 @@ endif
############################################################
test_core_base = {
'link_with' : [libcore, libshared],
'includes' : core_includes,
}
fuzzers += [
[files('fuzz-unit-file.c'),
[libcore,
libshared],
[libmount]],
{
'sources' : files('fuzz-unit-file.c'),
'link_with' : [
libcore,
libshared
],
'dependencies' : libmount,
},
]

View File

@ -13,7 +13,11 @@ if conf.get('ENABLE_COREDUMP') == 1 and install_sysconfdir_samples
endif
tests += [
[files('test-coredump-vacuum.c',
'coredump-vacuum.c'),
[], [], [], '', 'manual'],
{
'sources' : files(
'test-coredump-vacuum.c',
'coredump-vacuum.c',
),
'type' : 'manual',
},
]

View File

@ -1,25 +1,15 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
fuzzers += [
[files('fuzz-bootspec.c')],
[files('fuzz-bus-label.c')],
[files('fuzz-calendarspec.c')],
[files('fuzz-catalog.c')],
[files('fuzz-compress.c')],
[files('fuzz-env-file.c')],
[files('fuzz-hostname-setup.c')],
[files('fuzz-json.c')],
[files('fuzz-time-util.c')],
[files('fuzz-udev-database.c')],
[files('fuzz-varlink.c')],
]
simple_fuzzers += files(
'fuzz-bootspec.c',
'fuzz-bus-label.c',
'fuzz-calendarspec.c',
'fuzz-catalog.c',
'fuzz-compress.c',
'fuzz-env-file.c',
'fuzz-hostname-setup.c',
'fuzz-json.c',
'fuzz-time-util.c',
'fuzz-udev-database.c',
'fuzz-varlink.c',
)

View File

@ -52,9 +52,13 @@ if conf.get('ENABLE_IMPORTD') == 1
endif
tests += [
[files('test-qcow2.c',
'qcow2-util.c'),
[],
[libz],
[], 'HAVE_ZLIB', 'manual'],
{
'sources' : files(
'test-qcow2.c',
'qcow2-util.c',
),
'dependencies' : libz,
'condition' : 'HAVE_ZLIB',
'type' : 'manual',
},
]

View File

@ -69,9 +69,12 @@ endif
############################################################
fuzzers += [
[files('fuzz-journal-remote.c'),
[libsystemd_journal_remote,
libshared],
[],
[journal_includes]],
{
'sources' : files('fuzz-journal-remote.c'),
'link_with' : [
libshared,
libsystemd_journal_remote,
],
'includes' : journal_includes,
},
]

View File

@ -65,77 +65,98 @@ endif
############################################################
test_journal_base = {
'link_with' : [libjournal_core, libshared],
}
tests += [
[files('test-journal-syslog.c'),
[libjournal_core,
libshared],
[threads,
libxz,
liblz4,
libselinux]],
[files('test-journal-config.c'),
[libjournal_core,
libshared],
[libxz,
liblz4,
libselinux]],
[files('test-journal.c'),
[libjournal_core,
libshared]],
[files('test-journal-stream.c'),
[libjournal_core,
libshared]],
[files('test-journal-flush.c'),
[libjournal_core,
libshared]],
[files('test-journal-verify.c'),
[libjournal_core,
libshared]],
[files('test-journal-interleaving.c'),
[libjournal_core,
libshared]],
{
'sources' : files('test-journal-config.c'),
'dependencies' : [
liblz4,
libselinux,
libxz,
],
'base' : test_journal_base,
},
{
'sources' : files('test-journal-flush.c'),
'base' : test_journal_base,
},
{
'sources' : files('test-journal-interleaving.c'),
'base' : test_journal_base,
},
{
'sources' : files('test-journal-stream.c'),
'base' : test_journal_base,
},
{
'sources' : files('test-journal-syslog.c'),
'dependencies' : [
liblz4,
libselinux,
libxz,
threads,
],
'base' : test_journal_base,
},
{
'sources' : files('test-journal-verify.c'),
'base' : test_journal_base,
},
{
'sources' : files('test-journal.c'),
'base' : test_journal_base,
},
]
fuzzer_journald_base = {
'link_with' : [libjournal_core, libshared],
'dependencies' : [libselinux],
}
fuzzers += [
[files('fuzz-journald-audit.c',
'fuzz-journald.c'),
[libjournal_core,
libshared],
[libselinux]],
[files('fuzz-journald-kmsg.c',
'fuzz-journald.c'),
[libjournal_core,
libshared],
[libselinux]],
[files('fuzz-journald-native.c',
'fuzz-journald.c'),
[libjournal_core,
libshared],
[libselinux]],
[files('fuzz-journald-native-fd.c',
'fuzz-journald.c'),
[libjournal_core,
libshared],
[libselinux]],
[files('fuzz-journald-stream.c',
'fuzz-journald.c'),
[libjournal_core,
libshared],
[libselinux]],
[files('fuzz-journald-syslog.c',
'fuzz-journald.c'),
[libjournal_core,
libshared],
[libselinux]],
{
'sources' : files(
'fuzz-journald-audit.c',
'fuzz-journald.c',
),
'base' : fuzzer_journald_base,
},
{
'sources' : files(
'fuzz-journald-kmsg.c',
'fuzz-journald.c',
),
'base' : fuzzer_journald_base,
},
{
'sources' : files(
'fuzz-journald-native.c',
'fuzz-journald.c',
),
'base' : fuzzer_journald_base,
},
{
'sources' : files(
'fuzz-journald-native-fd.c',
'fuzz-journald.c',
),
'base' : fuzzer_journald_base,
},
{
'sources' : files(
'fuzz-journald-stream.c',
'fuzz-journald.c',
),
'base' : fuzzer_journald_base,
},
{
'sources' : files(
'fuzz-journald-syslog.c',
'fuzz-journald.c',
),
'base' : fuzzer_journald_base,
},
]

View File

@ -38,76 +38,86 @@ libsystemd_network_includes = [includes, include_directories('.')]
############################################################
test_libsystemd_network_base = {
'link_with' : [libshared, libsystemd_network],
}
tests += [
[files('test-dhcp-option.c'),
[libshared,
libsystemd_network]],
[files('test-sd-dhcp-lease.c'),
[libshared,
libsystemd_network]],
[files('test-dhcp-client.c'),
[libshared,
libsystemd_network]],
[files('test-dhcp-server.c'),
[libshared,
libsystemd_network]],
[files('test-ipv4ll.c'),
[libshared,
libsystemd_network]],
[files('test-ipv4ll-manual.c'),
[libshared,
libsystemd_network],
[], [], '', 'manual'],
[files('test-acd.c'),
[libshared,
libsystemd_network],
[], [], '', 'manual'],
[files('test-ndisc-rs.c'),
[libshared,
libsystemd_network]],
[files('test-ndisc-ra.c'),
[libshared,
libsystemd_network]],
[files('test-dhcp6-client.c'),
[libshared,
libsystemd_network]],
[files('test-lldp-rx.c'),
[libshared,
libsystemd_network]],
{
'sources' : files('test-acd.c'),
'base' : test_libsystemd_network_base,
'type' : 'manual',
},
{
'sources' : files('test-dhcp-client.c'),
'base' : test_libsystemd_network_base,
},
{
'sources' : files('test-dhcp-option.c'),
'base' : test_libsystemd_network_base,
},
{
'sources' : files('test-dhcp-server.c'),
'base' : test_libsystemd_network_base,
},
{
'sources' : files('test-dhcp6-client.c'),
'base' : test_libsystemd_network_base,
},
{
'sources' : files('test-ipv4ll-manual.c'),
'base' : test_libsystemd_network_base,
'type' : 'manual',
},
{
'sources' : files('test-ipv4ll.c'),
'base' : test_libsystemd_network_base,
},
{
'sources' : files('test-lldp-rx.c'),
'base' : test_libsystemd_network_base,
},
{
'sources' : files('test-ndisc-ra.c'),
'base' : test_libsystemd_network_base,
},
{
'sources' : files('test-ndisc-rs.c'),
'base' : test_libsystemd_network_base,
},
{
'sources' : files('test-sd-dhcp-lease.c'),
'base' : test_libsystemd_network_base,
},
]
fuzzer_network_base = {
'link_with' : [libshared, libsystemd_network],
}
fuzzers += [
[files('fuzz-dhcp-client.c'),
[libshared,
libsystemd_network]],
[files('fuzz-dhcp6-client.c'),
[libshared,
libsystemd_network]],
[files('fuzz-dhcp-server.c'),
[libsystemd_network,
libshared]],
[files('fuzz-dhcp-server-relay.c'),
[libsystemd_network,
libshared]],
[files('fuzz-lldp-rx.c'),
[libshared,
libsystemd_network]],
[files('fuzz-ndisc-rs.c'),
[libshared,
libsystemd_network]],
{
'sources' : files('fuzz-dhcp-client.c'),
'base' : fuzzer_network_base,
},
{
'sources' : files('fuzz-dhcp6-client.c'),
'base' : fuzzer_network_base,
},
{
'sources' : files('fuzz-dhcp-server.c'),
'base' : fuzzer_network_base,
},
{
'sources' : files('fuzz-dhcp-server-relay.c'),
'base' : fuzzer_network_base,
},
{
'sources' : files('fuzz-lldp-rx.c'),
'base' : fuzzer_network_base,
},
{
'sources' : files('fuzz-ndisc-rs.c'),
'base' : fuzzer_network_base,
},
]

View File

@ -142,116 +142,106 @@ libsystemd_pc = custom_target(
############################################################
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-file.c')],
[files('sd-journal/test-journal-send.c')],
[files('sd-journal/test-journal-match.c')],
[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')],
{
'sources' : files('sd-journal/test-journal-enum.c'),
'timeout' : 360,
},
]
############################################################
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'),
[],
[threads]],
[files('sd-bus/test-bus-marshal.c'),
[],
[threads,
libglib,
libgobject,
libgio,
libdbus,
libm]],
[files('sd-bus/test-bus-signature.c'),
[],
[threads]],
[files('sd-bus/test-bus-queue-ref-cycle.c'),
[],
[threads]],
[files('sd-bus/test-bus-watch-bind.c'),
[],
[threads],
[], '', 'timeout=120'],
[files('sd-bus/test-bus-chat.c'),
[],
[threads]],
[files('sd-bus/test-bus-cleanup.c'),
[],
[threads,
libseccomp]],
[files('sd-bus/test-bus-track.c'),
[],
[libseccomp]],
[files('sd-bus/test-bus-server.c'),
[],
[threads]],
[files('sd-bus/test-bus-objects.c'),
[],
[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')],
{
'sources' : files('sd-bus/test-bus-address.c'),
'dependencies' : threads
},
{
'sources' : files('sd-bus/test-bus-benchmark.c'),
'dependencies' : threads,
'type' : 'manual',
},
{
'sources' : files('sd-bus/test-bus-chat.c'),
'dependencies' : threads,
},
{
'sources' : files('sd-bus/test-bus-cleanup.c'),
'dependencies' : [threads, libseccomp],
},
{
'sources' : files('sd-bus/test-bus-marshal.c'),
'dependencies' : [
libdbus,
libgio,
libglib,
libgobject,
libm,
threads,
],
},
{
'sources' : files('sd-bus/test-bus-objects.c'),
'dependencies' : threads,
},
{
'sources' : files('sd-bus/test-bus-queue-ref-cycle.c'),
'dependencies' : threads,
},
{
'sources' : files('sd-bus/test-bus-server.c'),
'dependencies' : threads,
},
{
'sources' : files('sd-bus/test-bus-signature.c'),
'dependencies' : threads,
},
{
'sources' : files('sd-bus/test-bus-track.c'),
'dependencies' : libseccomp,
},
{
'sources' : files('sd-bus/test-bus-watch-bind.c'),
'dependencies' : threads,
'timeout' : 120,
},
{
'sources' : files('sd-resolve/test-resolve.c'),
'dependencies' : threads,
'timeout' : 120,
},
]
if cxx_cmd != ''
tests += [
[files('sd-bus/test-bus-vtable-cc.cc')],
]
simple_tests += files('sd-bus/test-bus-vtable-cc.cc')
endif
############################################################
fuzzers += [
[files('sd-bus/fuzz-bus-message.c')],
[files('sd-bus/fuzz-bus-match.c')],
]
simple_fuzzers += files(
'sd-bus/fuzz-bus-match.c',
'sd-bus/fuzz-bus-message.c',
)

View File

@ -43,7 +43,11 @@ libudev_pc = custom_target(
############################################################
tests += [
[files('test-libudev.c'),
[libshared,
libudev_basic]],
{
'sources' : files('test-libudev.c'),
'link_with' : [
libshared,
libudev_basic,
],
},
]

View File

@ -29,6 +29,10 @@ if conf.get('ENABLE_LOCALED') == 1
endif
tests += [
[files('test-localed-util.c',
'localed-util.c')],
{
'sources' : files(
'test-localed-util.c',
'localed-util.c',
),
},
]

View File

@ -77,17 +77,25 @@ endif
############################################################
simple_tests += files(
'test-login-shared.c'
)
tests += [
[files('test-login-shared.c')],
[files('test-inhibit.c'),
[], [], [], '', 'manual'],
[files('test-login-tables.c'),
[liblogind_core,
libshared],
[threads]],
[files('test-session-properties.c'),
[], [], [], '', 'manual'],
{
'sources' : files('test-inhibit.c'),
'type' : 'manual',
},
{
'sources' : files('test-login-tables.c'),
'link_with' : [
liblogind_core,
libshared,
],
'dependencies' : threads,
},
{
'sources' : files('test-session-properties.c'),
'type' : 'manual',
},
]

View File

@ -31,8 +31,12 @@ if conf.get('ENABLE_MACHINED') == 1
endif
tests += [
[files('test-machine-tables.c'),
[libmachine_core,
libshared],
[threads]],
{
'sources' : files('test-machine-tables.c'),
'link_with': [
libmachine_core,
libshared
],
'dependencies': threads,
},
]

View File

@ -171,53 +171,57 @@ if conf.get('ENABLE_NETWORKD') == 1
endif
endif
fuzzers += [
[files('fuzz-netdev-parser.c'),
[libnetworkd_core,
libsystemd_network,
networkd_link_with],
[threads],
network_includes],
fuzzer_network_base = {
'link_with' : [libnetworkd_core, libsystemd_network, networkd_link_with],
'dependencies' : threads,
'includes' : network_includes,
}
[files('fuzz-network-parser.c'),
[libnetworkd_core,
libsystemd_network,
networkd_link_with],
[threads],
network_includes],
fuzzers += [
{
'sources' : files('fuzz-netdev-parser.c'),
'base' : fuzzer_network_base,
},
{
'sources' : files('fuzz-network-parser.c'),
'base' : fuzzer_network_base,
},
]
test_network_base = {
'link_with' : [libnetworkd_core, libsystemd_network],
'includes' : network_includes,
}
tests += [
[files('test-networkd-address.c'),
[libnetworkd_core,
libsystemd_network],
[libatomic],
network_includes],
[files('test-networkd-conf.c'),
[libnetworkd_core,
libsystemd_network],
[libatomic],
network_includes],
[files('test-networkd-util.c'),
[libnetworkd_core,
libsystemd_network],
[],
network_includes],
[files('test-network.c'),
[libnetworkd_core,
libsystemd_network],
[threads],
network_includes],
[files('test-network-tables.c'),
[libnetworkd_core,
libsystemd_network],
[threads],
network_includes],
[files('generator/test-network-generator.c',
'generator/network-generator.c')],
{
'sources' : files(
'generator/network-generator.c',
'generator/test-network-generator.c'
)
},
{
'sources' : files('test-network-tables.c'),
'dependencies' : threads,
'base' : test_network_base,
},
{
'sources' : files('test-network.c'),
'dependencies' : threads,
'base' : test_network_base,
},
{
'sources' : files('test-networkd-address.c'),
'dependencies' : libatomic,
'base' : test_network_base,
},
{
'sources' : files('test-networkd-conf.c'),
'dependencies' : libatomic,
'base' : test_network_base,
},
{
'sources' : files('test-networkd-util.c'),
'base' : test_network_base,
},
]

View File

@ -39,31 +39,45 @@ systemd_nspawn_sources = files('nspawn.c')
############################################################
tests += [
[files('test-nspawn-tables.c'),
[libnspawn_core,
libshared],
[libseccomp]],
[files('test-nspawn-util.c'),
[libnspawn_core,
libshared],
[libseccomp]],
[files('test-patch-uid.c'),
[libnspawn_core,
libshared],
[libacl],
[], '', 'manual'],
{
'sources' : files('test-nspawn-tables.c'),
'link_with' : [
libnspawn_core,
libshared,
],
'dependencies' : libseccomp,
},
{
'sources' : files('test-nspawn-util.c'),
'link_with' : [
libnspawn_core,
libshared,
],
'dependencies' : libseccomp,
},
{
'sources' : files('test-patch-uid.c'),
'link_with' : [
libnspawn_core,
libshared,
],
'dependencies' : libacl,
'type' : 'manual',
},
]
fuzzer_nspawn_base = {
'link_with' : [libshared, libnspawn_core],
'dependencies' : libseccomp
}
fuzzers += [
[files('fuzz-nspawn-settings.c'),
[libshared,
libnspawn_core],
[libseccomp]],
[files('fuzz-nspawn-oci.c'),
[libshared,
libnspawn_core],
[libseccomp]],
{
'sources' : files('fuzz-nspawn-settings.c'),
'base' : fuzzer_nspawn_base,
},
{
'sources' : files('fuzz-nspawn-oci.c'),
'base' : fuzzer_nspawn_base,
},
]

View File

@ -23,8 +23,11 @@ if conf.get('ENABLE_OOMD') == 1
endif
tests += [
[files('test-oomd-util.c',
'oomd-util.c'),
[],
[libatomic]]
{
'sources' : files(
'test-oomd-util.c',
'oomd-util.c',
),
'dependencies' : libatomic,
},
]

View File

@ -137,72 +137,77 @@ custom_target(
############################################################
test_resolve_base = {
'link_with' : [libsystemd_resolve_core, libshared],
'dependencies' : [lib_openssl_or_gcrypt, libm],
}
tests += [
[files('test-resolve-tables.c'),
[libsystemd_resolve_core,
libshared],
[lib_openssl_or_gcrypt,
libm]],
[files('test-dns-packet.c'),
[libsystemd_resolve_core,
libshared],
[lib_openssl_or_gcrypt,
libm]],
[files('test-resolved-etc-hosts.c',
'resolved-etc-hosts.c'),
[libsystemd_resolve_core,
libshared],
[lib_openssl_or_gcrypt,
libm]],
[files('test-resolved-packet.c'),
[libsystemd_resolve_core,
libshared],
[lib_openssl_or_gcrypt,
libm]],
[files('test-resolved-stream.c')
+ basic_dns_sources + systemd_resolved_sources,
[libshared],
[lib_openssl_or_gcrypt,
libm]
+ systemd_resolved_dependencies,
resolve_includes],
[files('test-dnssec.c'),
[libsystemd_resolve_core,
libshared],
[lib_openssl_or_gcrypt,
libm],
[], 'HAVE_OPENSSL_OR_GCRYPT'],
[files('test-dnssec-complex.c'),
[libsystemd_resolve_core,
libshared],
[lib_openssl_or_gcrypt,
libm],
[], '', 'manual'],
{
'sources' : files('test-resolve-tables.c'),
'base' : test_resolve_base,
},
{
'sources' : files('test-dns-packet.c'),
'base' : test_resolve_base,
},
{
'sources' : files(
'test-resolved-etc-hosts.c',
'resolved-etc-hosts.c',
),
'base' : test_resolve_base,
},
{
'sources' : files('test-resolved-packet.c'),
'base' : test_resolve_base,
},
{
'sources' : files('test-dnssec.c'),
'base' : test_resolve_base,
'condition' : 'HAVE_OPENSSL_OR_GCRYPT',
},
{
'sources' : files('test-dnssec-complex.c'),
'base' : test_resolve_base,
'type' : 'manual',
},
{
'sources' : [
files('test-resolved-stream.c'),
basic_dns_sources,
systemd_resolved_sources,
],
'dependencies' : [
lib_openssl_or_gcrypt,
libm,
systemd_resolved_dependencies,
],
'includes' : resolve_includes,
},
]
fuzzer_resolve_base = {
'link_with' : [libsystemd_resolve_core, libshared],
'dependencies' : [lib_openssl_or_gcrypt, libm],
}
fuzzers += [
[files('fuzz-dns-packet.c'),
[libsystemd_resolve_core,
libshared],
[lib_openssl_or_gcrypt,
libm]],
[files('fuzz-etc-hosts.c',
'resolved-etc-hosts.c'),
[libsystemd_resolve_core,
libshared],
[lib_openssl_or_gcrypt,
libm]],
[files('fuzz-resource-record.c'),
[libsystemd_resolve_core,
libshared],
[lib_openssl_or_gcrypt,
libm]],
{
'sources' : files('fuzz-dns-packet.c'),
'base' : fuzzer_resolve_base,
},
{
'sources' : files(
'fuzz-etc-hosts.c',
'resolved-etc-hosts.c',
),
'base' : fuzzer_resolve_base,
},
{
'sources' : files('fuzz-resource-record.c'),
'base' : fuzzer_resolve_base,
},
]
systemd_resolved_sources += files('resolved.c')

View File

@ -6,8 +6,11 @@ systemd_shutdown_sources = files(
)
tests += [
[files('test-umount.c',
'umount.c'),
[],
[libmount]],
{
'sources' : files(
'test-umount.c',
'umount.c',
),
'dependencies' : libmount,
},
]

View File

@ -48,8 +48,12 @@ else
endif
fuzzers += [
[files('fuzz-systemctl-parse-argv.c') +
systemctl_sources,
systemctl_link_with,
[], [], ['-DFUZZ_SYSTEMCTL_PARSE_ARGV']]
{
'sources' : [
files('fuzz-systemctl-parse-argv.c'),
systemctl_sources,
],
'link_with' : systemctl_link_with,
'c_args' : '-DFUZZ_SYSTEMCTL_PARSE_ARGV',
},
]

File diff suppressed because it is too large Load Diff

View File

@ -54,8 +54,12 @@ endif
############################################################
tests += [
[files('test-timesync.c'),
[libtimesyncd_core,
libshared],
[libm]],
{
'sources' : files('test-timesync.c'),
'link_with' : [
libshared,
libtimesyncd_core,
],
'dependencies' : libm,
},
]

View File

@ -6,6 +6,10 @@ systemd_tmpfiles_sources = files(
)
tests += [
[files('test-offline-passwd.c',
'offline-passwd.c')],
{
'sources' : files(
'test-offline-passwd.c',
'offline-passwd.c',
),
},
]

View File

@ -160,45 +160,55 @@ if install_sysconfdir
mkdir_p.format(sysconfdir / 'udev/rules.d'))
endif
simple_fuzzers += files(
'fuzz-udev-rule-parse-value.c',
)
fuzzer_udev_base = {
'link_with' : [libudevd_core, libshared],
'dependencies' : [threads, libacl],
}
fuzzers += [
[files('net/fuzz-link-parser.c'),
[libudevd_core,
libshared],
[threads,
libacl],
udev_includes],
[files('fuzz-udev-rules.c'),
[libudevd_core,
libshared],
[threads,
libacl]],
[files('fuzz-udev-rule-parse-value.c')],
[files('fido_id/fuzz-fido-id-desc.c',
'fido_id/fido_id_desc.c')],
{
'sources' : files('net/fuzz-link-parser.c'),
'includes' : udev_includes,
'base' : fuzzer_udev_base,
},
{
'sources' : files('fuzz-udev-rules.c'),
'base' : fuzzer_udev_base,
},
{
'sources' : files(
'fido_id/fuzz-fido-id-desc.c',
'fido_id/fido_id_desc.c',
),
},
]
test_libudev_base = {
'link_with' : [libudevd_core, libshared],
'dependencies' : [threads, libacl],
}
tests += [
[files('test-udev-event.c'),
[libudevd_core,
libshared],
[threads,
libacl]],
[files('test-udev-node.c'),
[libudevd_core,
libshared],
[threads,
libacl]],
[files('test-udev-builtin.c'),
[libudevd_core,
libshared],
[threads,
libacl]],
[files('fido_id/test-fido-id-desc.c',
'fido_id/fido_id_desc.c')],
{
'sources' : files(
'fido_id/test-fido-id-desc.c',
'fido_id/fido_id_desc.c',
),
},
{
'sources' : files('test-udev-builtin.c'),
'base' : test_libudev_base,
},
{
'sources' : files('test-udev-event.c'),
'base' : test_libudev_base,
},
{
'sources' : files('test-udev-node.c'),
'base' : test_libudev_base,
},
]

View File

@ -6,11 +6,19 @@ systemd_xdg_autostart_generator_sources = files(
)
tests += [
[files('test-xdg-autostart.c',
'xdg-autostart-service.c')],
{
'sources' : files(
'test-xdg-autostart.c',
'xdg-autostart-service.c',
),
},
]
fuzzers += [
[files('fuzz-xdg-desktop.c',
'xdg-autostart-service.c')],
{
'sources' : files(
'fuzz-xdg-desktop.c',
'xdg-autostart-service.c',
),
},
]