mirror of
https://github.com/systemd/systemd.git
synced 2025-01-09 01:18:19 +03:00
meson: merge declarations of normal and test executables
This commit is contained in:
parent
09fa0a0721
commit
130c87b16a
241
meson.build
241
meson.build
@ -2172,8 +2172,8 @@ man_page_depends = []
|
||||
|
||||
############################################################
|
||||
|
||||
tests = []
|
||||
simple_tests = []
|
||||
libsystemd_tests = []
|
||||
fuzzers = []
|
||||
simple_fuzzers = []
|
||||
catalogs = []
|
||||
@ -2303,6 +2303,27 @@ install_libudev_static = static_library(
|
||||
|
||||
############################################################
|
||||
|
||||
runtest_env = custom_target(
|
||||
'systemd-runtest.env',
|
||||
output : 'systemd-runtest.env',
|
||||
command : [sh, '-c',
|
||||
'{ echo SYSTEMD_TEST_DATA=@0@; echo SYSTEMD_CATALOG_DIR=@1@; } >@OUTPUT@'.format(
|
||||
project_source_root / 'test',
|
||||
project_build_root / 'catalog')],
|
||||
depends : catalogs,
|
||||
build_by_default : true)
|
||||
|
||||
test_cflags = ['-DTEST_CODE=1']
|
||||
# We intentionally do not do inline initializations with definitions for a
|
||||
# bunch of _cleanup_ variables in tests, to ensure valgrind is triggered if we
|
||||
# use the variable unexpectedly. This triggers a lot of maybe-uninitialized
|
||||
# false positives when the combination of -O2 and -flto is used. Suppress them.
|
||||
if '-O2' in c_args and '-flto=auto' in c_args
|
||||
test_cflags += cc.first_supported_argument('-Wno-maybe-uninitialized')
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
||||
executable_template = {
|
||||
'include_directories' : includes,
|
||||
'link_with' : libshared,
|
||||
@ -2322,6 +2343,17 @@ executable_additional_kwargs = {
|
||||
'dependencies' : userspace,
|
||||
}
|
||||
|
||||
test_template = executable_template + {
|
||||
'build_by_default' : want_tests != 'false',
|
||||
'install' : install_tests,
|
||||
'install_dir' : unittestsdir,
|
||||
}
|
||||
|
||||
test_additional_kwargs = {
|
||||
'c_args' : test_cflags,
|
||||
'link_depends' : runtest_env,
|
||||
}
|
||||
|
||||
nss_template = {
|
||||
'version' : '2',
|
||||
'include_directories' : includes,
|
||||
@ -2475,8 +2507,22 @@ alias_target('devel', libsystemd_pc, libudev_pc, systemd_pc, udev_pc)
|
||||
|
||||
############################################################
|
||||
|
||||
foreach test : simple_tests
|
||||
executables += test_template + { 'sources' : [test] }
|
||||
endforeach
|
||||
|
||||
foreach test : libsystemd_tests
|
||||
executables += test_template + test
|
||||
endforeach
|
||||
|
||||
foreach dict : executables
|
||||
name = dict.get('name')
|
||||
name = dict.get('name', '')
|
||||
if name == ''
|
||||
name = fs.stem(dict.get('sources')[0])
|
||||
assert(name.split('-')[0] == 'test')
|
||||
endif
|
||||
|
||||
is_test = name.startswith('test-')
|
||||
|
||||
build = true
|
||||
foreach cond : dict.get('conditions', [])
|
||||
@ -2491,9 +2537,11 @@ foreach dict : executables
|
||||
|
||||
kwargs = {}
|
||||
foreach key, val : dict
|
||||
if key in ['name', 'dbus', 'public', 'conditions']
|
||||
if key in ['name', 'dbus', 'public', 'conditions',
|
||||
'type', 'suite', 'timeout', 'parallel']
|
||||
continue
|
||||
endif
|
||||
|
||||
kwargs += { key : val }
|
||||
endforeach
|
||||
|
||||
@ -2501,6 +2549,13 @@ foreach dict : executables
|
||||
kwargs += { key : [ kwargs.get(key, []), val ]}
|
||||
endforeach
|
||||
|
||||
if is_test
|
||||
kwargs += { 'install_dir' : kwargs.get('install_dir') / dict.get('type', '') }
|
||||
foreach key, val : test_additional_kwargs
|
||||
kwargs += { key : [ kwargs.get(key, []), val ] }
|
||||
endforeach
|
||||
endif
|
||||
|
||||
exe = executable(
|
||||
name,
|
||||
kwargs : kwargs,
|
||||
@ -2516,20 +2571,34 @@ foreach dict : executables
|
||||
public_programs += exe
|
||||
endif
|
||||
endif
|
||||
|
||||
if is_test
|
||||
type = dict.get('type', '')
|
||||
suite = dict.get('suite', '')
|
||||
if suite == ''
|
||||
suite = fs.name(fs.parent(dict.get('sources')[0]))
|
||||
if suite.startswith('sd-')
|
||||
suite = 'libsystemd'
|
||||
endif
|
||||
endif
|
||||
|
||||
if type == 'manual'
|
||||
message('@0@/@1@ is a manual test'.format(suite, name))
|
||||
elif type == 'unsafe' and want_tests != 'unsafe'
|
||||
message('@0@/@1@ is an unsafe test'.format(suite, name))
|
||||
elif dict.get('build_by_default')
|
||||
test(name, exe,
|
||||
env : test_env,
|
||||
timeout : dict.get('timeout', 30),
|
||||
suite : suite,
|
||||
is_parallel : dict.get('parallel', true))
|
||||
endif
|
||||
endif
|
||||
endforeach
|
||||
|
||||
############################################################
|
||||
|
||||
# only static linking apart from libdl, to make sure that the
|
||||
# module is linked to all libraries that it uses.
|
||||
test_dlopen = executable(
|
||||
'test-dlopen',
|
||||
test_dlopen_c,
|
||||
include_directories : includes,
|
||||
link_with : [libbasic],
|
||||
dependencies : [libdl,
|
||||
userspace],
|
||||
build_by_default : want_tests != 'false')
|
||||
test_dlopen = executables_by_name.get('test-dlopen')
|
||||
|
||||
foreach dict : modules
|
||||
name = dict.get('name')
|
||||
@ -2606,152 +2675,6 @@ endif
|
||||
subdir('rules.d')
|
||||
subdir('test')
|
||||
|
||||
runtest_env = custom_target(
|
||||
'systemd-runtest.env',
|
||||
output : 'systemd-runtest.env',
|
||||
command : [sh, '-c',
|
||||
'{ echo SYSTEMD_TEST_DATA=@0@; echo SYSTEMD_CATALOG_DIR=@1@; } >@OUTPUT@'.format(
|
||||
project_source_root / 'test',
|
||||
project_build_root / 'catalog')],
|
||||
depends : catalogs,
|
||||
build_by_default : true)
|
||||
|
||||
test_cflags = ['-DTEST_CODE=1']
|
||||
# We intentionally do not do inline initializations with definitions for a
|
||||
# bunch of _cleanup_ variables in tests, to ensure valgrind is triggered if we
|
||||
# use the variable unexpectedly. This triggers a lot of maybe-uninitialized
|
||||
# false positives when the combination of -O2 and -flto is used. Suppress them.
|
||||
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 += { 'sources' : [test] }
|
||||
endforeach
|
||||
|
||||
TESTS = {}
|
||||
foreach test : tests
|
||||
sources = test.get('sources')
|
||||
condition = test.get('condition', '')
|
||||
type = test.get('type', '')
|
||||
base = test.get('base', {})
|
||||
deps = [
|
||||
base.get('dependencies', []),
|
||||
test.get('dependencies', []),
|
||||
]
|
||||
|
||||
name = fs.name(sources[0])
|
||||
if name.endswith('.cc')
|
||||
deps += [versiondep]
|
||||
else
|
||||
deps += [userspace]
|
||||
endif
|
||||
name = fs.stem(name)
|
||||
|
||||
suite = fs.name(fs.parent(sources[0])).replace('sd-', '')
|
||||
|
||||
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 : deps,
|
||||
c_args : [test_cflags, test.get('c_args', [])],
|
||||
build_by_default : want_tests != 'false',
|
||||
install_rpath : pkglibdir,
|
||||
install : install_tests,
|
||||
install_dir : unittestsdir / 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
|
||||
|
||||
TESTS += { name : exe }
|
||||
endforeach
|
||||
|
||||
exe = executable(
|
||||
'test-libsystemd-sym',
|
||||
test_libsystemd_sym_c,
|
||||
include_directories : includes,
|
||||
link_with : [libsystemd],
|
||||
dependencies : userspace,
|
||||
build_by_default : want_tests != 'false',
|
||||
install : install_tests,
|
||||
install_dir : unittestsdir)
|
||||
if want_tests != 'false'
|
||||
test('test-libsystemd-sym', exe)
|
||||
endif
|
||||
|
||||
exe = executable(
|
||||
'test-libsystemd-static-sym',
|
||||
test_libsystemd_sym_c,
|
||||
include_directories : includes,
|
||||
link_with : [install_libsystemd_static],
|
||||
dependencies : [
|
||||
# threads is already included in dependencies on the library,
|
||||
# but does not seem to get propagated. Add here as a work-around.
|
||||
threads,
|
||||
userspace,
|
||||
],
|
||||
build_by_default : want_tests != 'false' and static_libsystemd != 'false',
|
||||
install : install_tests and static_libsystemd != 'false',
|
||||
install_dir : unittestsdir)
|
||||
if want_tests != 'false' and static_libsystemd != 'false'
|
||||
test('test-libsystemd-static-sym', exe)
|
||||
endif
|
||||
|
||||
exe = executable(
|
||||
'test-libudev-sym',
|
||||
test_libudev_sym_c,
|
||||
include_directories : libudev_includes,
|
||||
c_args : ['-Wno-deprecated-declarations'] + test_cflags,
|
||||
link_with : [libudev],
|
||||
dependencies : userspace,
|
||||
build_by_default : want_tests != 'false',
|
||||
install : install_tests,
|
||||
install_dir : unittestsdir)
|
||||
if want_tests != 'false'
|
||||
test('test-libudev-sym', exe)
|
||||
endif
|
||||
|
||||
exe = executable(
|
||||
'test-libudev-static-sym',
|
||||
test_libudev_sym_c,
|
||||
include_directories : libudev_includes,
|
||||
c_args : ['-Wno-deprecated-declarations'] + test_cflags,
|
||||
link_with : [install_libudev_static],
|
||||
dependencies : userspace,
|
||||
build_by_default : want_tests != 'false' and static_libudev != 'false',
|
||||
install : install_tests and static_libudev != 'false',
|
||||
install_dir : unittestsdir)
|
||||
if want_tests != 'false' and static_libudev != 'false'
|
||||
test('test-libudev-static-sym', exe)
|
||||
endif
|
||||
|
||||
if want_tests != 'false'
|
||||
exe = TESTS.get('test-udev-rule-runner')
|
||||
test('test-udev',
|
||||
test_udev_py,
|
||||
args : ['-v'],
|
||||
env : ['UDEV_RULE_RUNNER=' + exe.full_path()],
|
||||
depends : exe,
|
||||
timeout : 180)
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
||||
foreach fuzzer : simple_fuzzers
|
||||
|
@ -46,14 +46,10 @@ executables += [
|
||||
'dependencies' : libseccomp,
|
||||
'install' : conf.get('ENABLE_ANALYZE') == 1,
|
||||
},
|
||||
]
|
||||
|
||||
tests += [
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files(
|
||||
'test-verify.c',
|
||||
'analyze-verify-util.c',
|
||||
),
|
||||
'base' : test_core_base,
|
||||
},
|
||||
]
|
||||
|
@ -23,17 +23,16 @@ if efi_arch != ''
|
||||
libshared,
|
||||
],
|
||||
}
|
||||
efi_test_template = test_template + efitest_base
|
||||
|
||||
tests += [
|
||||
{
|
||||
executables += [
|
||||
efi_test_template + {
|
||||
'sources' : files('test-bcd.c'),
|
||||
'dependencies' : libzstd,
|
||||
'condition' : 'HAVE_ZSTD',
|
||||
'base' : efitest_base,
|
||||
'conditions' : ['HAVE_ZSTD'],
|
||||
},
|
||||
{
|
||||
efi_test_template + {
|
||||
'sources' : files('test-efi-string.c'),
|
||||
'base' : efitest_base,
|
||||
},
|
||||
]
|
||||
fuzzers += [
|
||||
|
@ -11,10 +11,7 @@ executables += [
|
||||
'public' : true,
|
||||
'sources' : busctl_sources,
|
||||
},
|
||||
]
|
||||
|
||||
tests += [
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-busctl-introspect.c',
|
||||
'busctl-introspect.c',
|
||||
|
@ -203,9 +203,13 @@ meson.add_install_script(meson_make_symlink,
|
||||
|
||||
############################################################
|
||||
|
||||
test_core_base = {
|
||||
'link_with' : [libcore, libshared],
|
||||
'includes' : core_includes,
|
||||
core_test_template = test_template + {
|
||||
'link_with' : [
|
||||
libcore,
|
||||
libshared,
|
||||
],
|
||||
'include_directories' : core_includes,
|
||||
'suite' : 'core',
|
||||
}
|
||||
|
||||
fuzzers += [
|
||||
|
@ -33,15 +33,7 @@ executables += [
|
||||
'link_with' : common_link_with,
|
||||
'dependencies' : common_dependencies,
|
||||
},
|
||||
]
|
||||
|
||||
if conf.get('ENABLE_COREDUMP') == 1 and install_sysconfdir_samples
|
||||
install_data('coredump.conf',
|
||||
install_dir : pkgsysconfdir)
|
||||
endif
|
||||
|
||||
tests += [
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-coredump-vacuum.c',
|
||||
'coredump-vacuum.c',
|
||||
@ -49,3 +41,8 @@ tests += [
|
||||
'type' : 'manual',
|
||||
},
|
||||
]
|
||||
|
||||
if conf.get('ENABLE_COREDUMP') == 1 and install_sysconfdir_samples
|
||||
install_data('coredump.conf',
|
||||
install_dir : pkgsysconfdir)
|
||||
endif
|
||||
|
@ -100,6 +100,15 @@ executables += [
|
||||
'link_with' : common_libs,
|
||||
'dependencies' : common_deps,
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-qcow2.c',
|
||||
'qcow2-util.c',
|
||||
),
|
||||
'dependencies' : libz,
|
||||
'conditions' : ['HAVE_ZLIB'],
|
||||
'type' : 'manual',
|
||||
},
|
||||
]
|
||||
|
||||
if conf.get('ENABLE_IMPORTD') == 1
|
||||
@ -114,15 +123,3 @@ if conf.get('ENABLE_IMPORTD') == 1
|
||||
install_dir : libexecdir)
|
||||
# TODO: shouldn't this be in pkgdatadir?
|
||||
endif
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files(
|
||||
'test-qcow2.c',
|
||||
'qcow2-util.c',
|
||||
),
|
||||
'dependencies' : libz,
|
||||
'condition' : 'HAVE_ZLIB',
|
||||
'type' : 'manual',
|
||||
},
|
||||
]
|
||||
|
@ -41,6 +41,13 @@ else
|
||||
]
|
||||
endif
|
||||
|
||||
journal_test_template = test_template + {
|
||||
'link_with' : [
|
||||
libjournal_core,
|
||||
libshared,
|
||||
],
|
||||
}
|
||||
|
||||
executables += [
|
||||
libexec_template + {
|
||||
'name' : 'systemd-journald',
|
||||
@ -80,6 +87,43 @@ executables += [
|
||||
threads,
|
||||
],
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal-append.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal-config.c'),
|
||||
'dependencies' : [
|
||||
liblz4,
|
||||
libselinux,
|
||||
libxz,
|
||||
],
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal-flush.c'),
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal-interleaving.c'),
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal-stream.c'),
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal-syslog.c'),
|
||||
'dependencies' : [
|
||||
liblz4,
|
||||
libselinux,
|
||||
libxz,
|
||||
threads,
|
||||
],
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal-verify.c'),
|
||||
'timeout' : 90,
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal.c'),
|
||||
},
|
||||
]
|
||||
|
||||
if install_sysconfdir_samples
|
||||
@ -109,58 +153,6 @@ endif
|
||||
|
||||
############################################################
|
||||
|
||||
test_journal_base = {
|
||||
'link_with' : [libjournal_core, libshared],
|
||||
}
|
||||
|
||||
tests += [
|
||||
{
|
||||
'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,
|
||||
'timeout' : 90,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-journal.c'),
|
||||
'base' : test_journal_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-journal-append.c'),
|
||||
'base' : test_journal_base,
|
||||
'type' : 'manual',
|
||||
},
|
||||
]
|
||||
|
||||
fuzzer_journald_base = {
|
||||
'link_with' : [libjournal_core, libshared],
|
||||
'dependencies' : [libselinux],
|
||||
|
@ -39,56 +39,49 @@ libsystemd_network_includes = [includes, include_directories('.')]
|
||||
|
||||
############################################################
|
||||
|
||||
test_libsystemd_network_base = {
|
||||
'link_with' : [libshared, libsystemd_network],
|
||||
network_test_template = test_template + {
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libsystemd_network,
|
||||
],
|
||||
'suite' : 'network',
|
||||
}
|
||||
|
||||
tests += [
|
||||
{
|
||||
executables += [
|
||||
network_test_template + {
|
||||
'sources' : files('test-acd.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-dhcp-client.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-dhcp-option.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-dhcp-server.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-dhcp6-client.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-ipv4ll-manual.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-ipv4ll.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-lldp-rx.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-ndisc-ra.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-ndisc-rs.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-sd-dhcp-lease.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
]
|
||||
|
||||
|
@ -154,7 +154,7 @@ simple_tests += files(
|
||||
'sd-journal/test-mmap-cache.c',
|
||||
)
|
||||
|
||||
tests += [
|
||||
libsystemd_tests += [
|
||||
{
|
||||
'sources' : files('sd-journal/test-journal-enum.c'),
|
||||
'timeout' : 360,
|
||||
@ -176,7 +176,7 @@ simple_tests += files(
|
||||
'sd-netlink/test-netlink.c',
|
||||
)
|
||||
|
||||
tests += [
|
||||
libsystemd_tests += [
|
||||
{
|
||||
'sources' : files('sd-bus/test-bus-address.c'),
|
||||
'dependencies' : threads
|
||||
|
@ -42,15 +42,3 @@ libudev_pc = custom_target(
|
||||
install : pkgconfiglibdir != 'no',
|
||||
install_tag : 'devel',
|
||||
install_dir : pkgconfiglibdir)
|
||||
|
||||
############################################################
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files('test-libudev.c'),
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libudev_basic,
|
||||
],
|
||||
},
|
||||
]
|
||||
|
@ -33,6 +33,14 @@ executables += [
|
||||
'conditions' : ['ENABLE_LOCALED'],
|
||||
'sources' : files('localectl.c'),
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-localed-util.c',
|
||||
'localed-util.c',
|
||||
'xkbcommon-util.c',
|
||||
),
|
||||
'dependencies' : libxkbcommon_deps,
|
||||
},
|
||||
]
|
||||
|
||||
# If you know a way that allows the same variables to be used
|
||||
@ -52,14 +60,3 @@ if conf.get('ENABLE_LOCALED') == 1
|
||||
'language-fallback-map',
|
||||
install_dir : pkgdatadir)
|
||||
endif
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files(
|
||||
'test-localed-util.c',
|
||||
'localed-util.c',
|
||||
'xkbcommon-util.c',
|
||||
),
|
||||
'dependencies' : libxkbcommon_deps,
|
||||
},
|
||||
]
|
||||
|
@ -82,8 +82,28 @@ executables += [
|
||||
'conditions' : ['ENABLE_LOGIND'],
|
||||
'sources' : files('user-runtime-dir.c'),
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('test-inhibit.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('test-login-tables.c'),
|
||||
'link_with' : [
|
||||
liblogind_core,
|
||||
libshared,
|
||||
],
|
||||
'dependencies' : threads,
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('test-session-properties.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
]
|
||||
|
||||
simple_tests += files(
|
||||
'test-login-shared.c'
|
||||
)
|
||||
|
||||
modules += [
|
||||
pam_template + {
|
||||
'name' : 'pam_systemd',
|
||||
@ -122,28 +142,3 @@ if enable_logind
|
||||
install_data('org.freedesktop.login1.policy',
|
||||
install_dir : polkitpolicydir)
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
||||
simple_tests += files(
|
||||
'test-login-shared.c'
|
||||
)
|
||||
|
||||
tests += [
|
||||
{
|
||||
'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',
|
||||
},
|
||||
]
|
||||
|
@ -41,6 +41,14 @@ executables += [
|
||||
threads,
|
||||
],
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('test-machine-tables.c'),
|
||||
'link_with': [
|
||||
libmachine_core,
|
||||
libshared
|
||||
],
|
||||
'dependencies': threads,
|
||||
},
|
||||
]
|
||||
|
||||
if conf.get('ENABLE_MACHINED') == 1
|
||||
@ -51,14 +59,3 @@ if conf.get('ENABLE_MACHINED') == 1
|
||||
install_data('org.freedesktop.machine1.policy',
|
||||
install_dir : polkitpolicydir)
|
||||
endif
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files('test-machine-tables.c'),
|
||||
'link_with': [
|
||||
libmachine_core,
|
||||
libshared
|
||||
],
|
||||
'dependencies': threads,
|
||||
},
|
||||
]
|
||||
|
@ -150,6 +150,14 @@ libnetworkd_core = static_library(
|
||||
link_with : networkd_link_with,
|
||||
build_by_default : false)
|
||||
|
||||
network_test_template = test_template + {
|
||||
'link_with' : [
|
||||
libnetworkd_core,
|
||||
libsystemd_network,
|
||||
],
|
||||
'include_directories' : network_includes,
|
||||
}
|
||||
|
||||
executables += [
|
||||
libexec_template + {
|
||||
'name' : 'systemd-networkd',
|
||||
@ -187,6 +195,32 @@ executables += [
|
||||
'sources' : network_generator_sources,
|
||||
'link_with' : networkd_link_with,
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'generator/test-network-generator.c',
|
||||
'generator/network-generator.c',
|
||||
),
|
||||
'suite' : 'network',
|
||||
},
|
||||
network_test_template + {
|
||||
'sources' : files('test-network-tables.c'),
|
||||
'dependencies' : threads,
|
||||
},
|
||||
network_test_template + {
|
||||
'sources' : files('test-network.c'),
|
||||
'dependencies' : threads,
|
||||
},
|
||||
network_test_template + {
|
||||
'sources' : files('test-networkd-address.c'),
|
||||
'dependencies' : libatomic,
|
||||
},
|
||||
network_test_template + {
|
||||
'sources' : files('test-networkd-conf.c'),
|
||||
'dependencies' : libatomic,
|
||||
},
|
||||
network_test_template + {
|
||||
'sources' : files('test-networkd-util.c'),
|
||||
},
|
||||
]
|
||||
|
||||
if conf.get('ENABLE_NETWORKD') == 1
|
||||
@ -227,41 +261,3 @@ fuzzers += [
|
||||
'base' : fuzzer_network_base,
|
||||
},
|
||||
]
|
||||
|
||||
test_network_base = {
|
||||
'link_with' : [libnetworkd_core, libsystemd_network],
|
||||
'includes' : network_includes,
|
||||
}
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files(
|
||||
'generator/test-network-generator.c',
|
||||
'generator/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,
|
||||
},
|
||||
]
|
||||
|
@ -40,6 +40,12 @@ nspawn_libs = [
|
||||
libshared,
|
||||
]
|
||||
|
||||
nspawn_common_template = {
|
||||
'link_with' : nspawn_libs,
|
||||
'dependencies' : libseccomp,
|
||||
}
|
||||
nspawn_test_template = test_template + nspawn_common_template
|
||||
|
||||
executables += [
|
||||
executable_template + {
|
||||
'name' : 'systemd-nspawn',
|
||||
@ -51,33 +57,15 @@ executables += [
|
||||
libseccomp,
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
############################################################
|
||||
|
||||
tests += [
|
||||
{
|
||||
nspawn_test_template + {
|
||||
'sources' : files('test-nspawn-tables.c'),
|
||||
'link_with' : [
|
||||
libnspawn_core,
|
||||
libshared,
|
||||
],
|
||||
'dependencies' : libseccomp,
|
||||
},
|
||||
{
|
||||
nspawn_test_template + {
|
||||
'sources' : files('test-nspawn-util.c'),
|
||||
'link_with' : [
|
||||
libnspawn_core,
|
||||
libshared,
|
||||
],
|
||||
'dependencies' : libseccomp,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-patch-uid.c'),
|
||||
'link_with' : [
|
||||
libnspawn_core,
|
||||
libshared,
|
||||
],
|
||||
'link_with' : nspawn_libs,
|
||||
'dependencies' : libacl,
|
||||
'type' : 'manual',
|
||||
},
|
||||
|
@ -21,6 +21,13 @@ executables += [
|
||||
'conditions' : ['ENABLE_OOMD'],
|
||||
'sources' : files('oomctl.c'),
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-oomd-util.c',
|
||||
'oomd-util.c',
|
||||
),
|
||||
'dependencies' : libatomic,
|
||||
},
|
||||
]
|
||||
|
||||
if conf.get('ENABLE_OOMD') == 1
|
||||
@ -35,13 +42,3 @@ if conf.get('ENABLE_OOMD') == 1
|
||||
install_dir : pkgsysconfdir)
|
||||
endif
|
||||
endif
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files(
|
||||
'test-oomd-util.c',
|
||||
'oomd-util.c',
|
||||
),
|
||||
'dependencies' : libatomic,
|
||||
},
|
||||
]
|
||||
|
@ -123,6 +123,18 @@ link_with = [
|
||||
libsystemd_resolve_core,
|
||||
]
|
||||
|
||||
resolve_common_template = {
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libsystemd_resolve_core,
|
||||
],
|
||||
'dependencies' : [
|
||||
lib_openssl_or_gcrypt,
|
||||
libm,
|
||||
],
|
||||
}
|
||||
resolve_test_template = test_template + resolve_common_template
|
||||
|
||||
executables += [
|
||||
libexec_template + {
|
||||
'name' : 'systemd-resolved',
|
||||
@ -147,6 +159,42 @@ executables += [
|
||||
threads,
|
||||
],
|
||||
},
|
||||
resolve_test_template + {
|
||||
'sources' : files('test-resolve-tables.c'),
|
||||
},
|
||||
resolve_test_template + {
|
||||
'sources' : files('test-dns-packet.c'),
|
||||
},
|
||||
resolve_test_template + {
|
||||
'sources' : files(
|
||||
'test-resolved-etc-hosts.c',
|
||||
'resolved-etc-hosts.c',
|
||||
),
|
||||
},
|
||||
resolve_test_template + {
|
||||
'sources' : files('test-resolved-packet.c'),
|
||||
},
|
||||
resolve_test_template + {
|
||||
'sources' : files('test-dnssec.c'),
|
||||
'conditions' : ['HAVE_OPENSSL_OR_GCRYPT'],
|
||||
},
|
||||
resolve_test_template + {
|
||||
'sources' : files('test-dnssec-complex.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
test_template + {
|
||||
'sources' : [
|
||||
files('test-resolved-stream.c'),
|
||||
basic_dns_sources,
|
||||
systemd_resolved_sources,
|
||||
],
|
||||
'dependencies' : [
|
||||
lib_openssl_or_gcrypt,
|
||||
libm,
|
||||
systemd_resolved_dependencies,
|
||||
],
|
||||
'include_directories' : resolve_includes,
|
||||
},
|
||||
]
|
||||
|
||||
if conf.get('ENABLE_RESOLVE') == 1
|
||||
@ -178,56 +226,6 @@ custom_target(
|
||||
|
||||
############################################################
|
||||
|
||||
test_resolve_base = {
|
||||
'link_with' : [libsystemd_resolve_core, libshared],
|
||||
'dependencies' : [lib_openssl_or_gcrypt, libm],
|
||||
}
|
||||
|
||||
tests += [
|
||||
{
|
||||
'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],
|
||||
|
@ -28,10 +28,7 @@ executables += [
|
||||
'build_by_default' : have_standalone_binaries,
|
||||
'install' : have_standalone_binaries,
|
||||
},
|
||||
]
|
||||
|
||||
tests += [
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-umount.c',
|
||||
'detach-swap.c',
|
||||
|
@ -39,8 +39,6 @@ test_libudev_sym_c = custom_target(
|
||||
capture : true,
|
||||
build_by_default : want_tests != 'false')
|
||||
|
||||
test_dlopen_c = files('test-dlopen.c')
|
||||
|
||||
############################################################
|
||||
|
||||
simple_tests += files(
|
||||
@ -195,49 +193,49 @@ common_test_dependencies = [
|
||||
threads,
|
||||
]
|
||||
|
||||
tests += [
|
||||
{
|
||||
executables += [
|
||||
test_template + {
|
||||
'sources' : files('test-acl-util.c'),
|
||||
'condition' : 'HAVE_ACL',
|
||||
'conditions' : ['HAVE_ACL'],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-af-list.c') +
|
||||
generated_gperf_headers,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-arphrd-util.c') +
|
||||
generated_gperf_headers,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-ask-password-api.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-async.c'),
|
||||
'timeout' : 120,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-boot-timestamps.c'),
|
||||
'condition' : 'ENABLE_EFI',
|
||||
'conditions' : ['ENABLE_EFI'],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-btrfs.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-cap-list.c') +
|
||||
generated_gperf_headers,
|
||||
'dependencies' : libcap,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-capability.c'),
|
||||
'dependencies' : libcap,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-chase-manual.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-compress-benchmark.c'),
|
||||
'link_with' : [
|
||||
libbasic_compress,
|
||||
@ -245,144 +243,152 @@ tests += [
|
||||
],
|
||||
'timeout' : 90,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-compress.c'),
|
||||
'link_with' : [
|
||||
libbasic_compress,
|
||||
libshared,
|
||||
],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-cryptolib.c'),
|
||||
'link_with' : libshared,
|
||||
'dependencies' : lib_openssl_or_gcrypt,
|
||||
'condition' : 'HAVE_OPENSSL_OR_GCRYPT',
|
||||
'conditions' : ['HAVE_OPENSSL_OR_GCRYPT'],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-dlopen-so.c'),
|
||||
'dependencies' : libp11kit_cflags
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
# only static linking apart from libdl, to make sure that the
|
||||
# module is linked to all libraries that it uses.
|
||||
'sources' : files('test-dlopen.c'),
|
||||
'link_with' : libbasic,
|
||||
'dependencies' : libdl,
|
||||
'install' : false,
|
||||
'type' : 'manual',
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('test-errno-list.c') +
|
||||
generated_gperf_headers,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-fd-util.c'),
|
||||
'dependencies' : libseccomp,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-hashmap.c',
|
||||
'test-hashmap-plain.c',
|
||||
) + [
|
||||
test_hashmap_ordered_c,
|
||||
],
|
||||
'test-hashmap.c',
|
||||
'test-hashmap-plain.c',
|
||||
) + [
|
||||
test_hashmap_ordered_c,
|
||||
],
|
||||
'timeout' : 180,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-ip-protocol-list.c') +
|
||||
shared_generated_gperf_headers,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-ipcrm.c'),
|
||||
'type' : 'unsafe',
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-json.c'),
|
||||
'dependencies' : libm,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-libcrypt-util.c'),
|
||||
'dependencies' : libcrypt,
|
||||
'timeout' : 120,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-libmount.c'),
|
||||
'dependencies' : [
|
||||
libmount,
|
||||
threads,
|
||||
],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-loopback.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-math-util.c'),
|
||||
'dependencies' : libm,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-mempress.c'),
|
||||
'dependencies' : threads,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-mount-util.c'),
|
||||
'dependencies' : libmount,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-netlink-manual.c'),
|
||||
'dependencies' : libkmod,
|
||||
'condition' : 'HAVE_KMOD',
|
||||
'conditions' : ['HAVE_KMOD'],
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-nscd-flush.c'),
|
||||
'condition' : 'ENABLE_NSCD',
|
||||
'conditions' : ['ENABLE_NSCD'],
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-nss-hosts.c',
|
||||
'nss-test-util.c',
|
||||
),
|
||||
'dependencies' : libdl,
|
||||
'condition' : 'ENABLE_NSS',
|
||||
'conditions' : ['ENABLE_NSS'],
|
||||
'timeout' : 120,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-nss-users.c',
|
||||
'nss-test-util.c',
|
||||
),
|
||||
'dependencies' : libdl,
|
||||
'condition' : 'ENABLE_NSS',
|
||||
'conditions' : ['ENABLE_NSS'],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-parse-util.c'),
|
||||
'dependencies' : libm,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-process-util.c'),
|
||||
'dependencies' : threads,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-qrcode-util.c'),
|
||||
'dependencies' : libdl,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-random-util.c'),
|
||||
'dependencies' : libm,
|
||||
'timeout' : 120,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-sbat.c'),
|
||||
'condition' : 'ENABLE_BOOTLOADER',
|
||||
'conditions' : ['ENABLE_BOOTLOADER'],
|
||||
'c_args' : '-I@0@'.format(efi_config_h_dir),
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-seccomp.c'),
|
||||
'dependencies' : libseccomp,
|
||||
'condition' : 'HAVE_SECCOMP',
|
||||
'conditions' : ['HAVE_SECCOMP'],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-set-disable-mempool.c'),
|
||||
'dependencies' : threads,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-sizeof.c'),
|
||||
'link_with' : libbasic,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-tables.c'),
|
||||
'link_with' : [
|
||||
libcore,
|
||||
@ -399,175 +405,190 @@ tests += [
|
||||
libxz,
|
||||
threads,
|
||||
],
|
||||
'includes' : [
|
||||
'include_directories' : [
|
||||
core_includes,
|
||||
journal_includes,
|
||||
udev_includes,
|
||||
],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-time-util.c'),
|
||||
'timeout' : 120,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-utmp.c'),
|
||||
'condition' : 'ENABLE_UTMP',
|
||||
'conditions' : ['ENABLE_UTMP'],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-varlink.c'),
|
||||
'dependencies' : threads,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-watchdog.c'),
|
||||
'type' : 'unsafe',
|
||||
},
|
||||
|
||||
# Symbol tests
|
||||
test_template + {
|
||||
'name' : 'test-libsystemd-sym',
|
||||
'sources' : test_libsystemd_sym_c,
|
||||
'link_with' : libsystemd,
|
||||
'suite' : 'libsystemd',
|
||||
},
|
||||
test_template + {
|
||||
'name' : 'test-libsystemd-static-sym',
|
||||
'sources' : test_libsystemd_sym_c,
|
||||
'link_with' : install_libsystemd_static,
|
||||
'build_by_default' : want_tests != 'false' and static_libsystemd != 'false',
|
||||
'install' : install_tests and static_libsystemd != 'false',
|
||||
'suite' : 'libsystemd',
|
||||
},
|
||||
test_template + {
|
||||
'name' : 'test-libudev-sym',
|
||||
'sources' : test_libudev_sym_c,
|
||||
'include_directories' : libudev_includes,
|
||||
'c_args' : ['-Wno-deprecated-declarations'] + test_cflags,
|
||||
'link_with' : libudev,
|
||||
'suite' : 'libudev',
|
||||
},
|
||||
test_template + {
|
||||
'name' : 'test-libudev-static-sym',
|
||||
'sources' : test_libudev_sym_c,
|
||||
'include_directories' : libudev_includes,
|
||||
'c_args' : ['-Wno-deprecated-declarations'] + test_cflags,
|
||||
'link_with' : install_libudev_static,
|
||||
'build_by_default' : want_tests != 'false' and static_libudev != 'false',
|
||||
'install' : install_tests and static_libudev != 'false',
|
||||
'suite' : 'libudev',
|
||||
},
|
||||
|
||||
# Tests that link to libcore, i.e. tests for pid1 code.
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-bpf-devices.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-bpf-firewall.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-bpf-foreign-programs.c'),
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-bpf-lsm.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-cgroup-cpu.c'),
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-cgroup-mask.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-cgroup-unit-default.c'),
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-chown-rec.c'),
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-core-unit.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-emergency-action.c'),
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-engine.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-execute.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
'timeout' : 360,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-install.c'),
|
||||
'base' : test_core_base,
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-job-type.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-load-fragment.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-loop-block.c'),
|
||||
'dependencies' : [threads, libblkid],
|
||||
'base' : test_core_base,
|
||||
'parallel' : false,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-manager.c'),
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-namespace.c'),
|
||||
'dependencies' : [
|
||||
libblkid,
|
||||
threads,
|
||||
],
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-ns.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-path.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
'timeout' : 120,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-sched-prio.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-socket-bind.c'),
|
||||
'dependencies' : libdl,
|
||||
'condition' : 'BPF_FRAMEWORK',
|
||||
'base' : test_core_base,
|
||||
'conditions' : ['BPF_FRAMEWORK'],
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-unit-name.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-unit-serialize.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-watch-pid.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
|
||||
# Tests from other directories that have link_with deps that were not defined earlier
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('../libsystemd/sd-bus/test-bus-error.c'),
|
||||
'link_with' : [
|
||||
libshared_static,
|
||||
libsystemd_static,
|
||||
],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('../libsystemd/sd-device/test-sd-device-thread.c'),
|
||||
'link_with' : libsystemd,
|
||||
'dependencies' : threads,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('../libudev/test-udev-device-thread.c'),
|
||||
'link_with' : libudev,
|
||||
'dependencies' : threads,
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('../libudev/test-libudev.c'),
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libudev_basic,
|
||||
],
|
||||
},
|
||||
]
|
||||
|
@ -50,6 +50,14 @@ executables += [
|
||||
'sources' : files('wait-sync.c'),
|
||||
'link_with' : libtimesyncd_core,
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('test-timesync.c'),
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libtimesyncd_core,
|
||||
],
|
||||
'dependencies' : libm,
|
||||
},
|
||||
]
|
||||
|
||||
custom_target(
|
||||
@ -70,16 +78,3 @@ if conf.get('ENABLE_TIMESYNCD') == 1
|
||||
install_data('org.freedesktop.timesync1.policy',
|
||||
install_dir : polkitpolicydir)
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files('test-timesync.c'),
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libtimesyncd_core,
|
||||
],
|
||||
'dependencies' : libm,
|
||||
},
|
||||
]
|
||||
|
@ -29,10 +29,7 @@ executables += [
|
||||
'build_by_default' : have_standalone_binaries,
|
||||
'install' : have_standalone_binaries,
|
||||
},
|
||||
]
|
||||
|
||||
tests += [
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-offline-passwd.c',
|
||||
'offline-passwd.c',
|
||||
|
@ -116,6 +116,14 @@ libudevd_core = static_library(
|
||||
userspace],
|
||||
build_by_default : false)
|
||||
|
||||
udev_dependencies = [
|
||||
libacl,
|
||||
libblkid,
|
||||
libidn,
|
||||
libkmod,
|
||||
threads,
|
||||
]
|
||||
|
||||
udev_plugin_template = executable_template + {
|
||||
'public' : true,
|
||||
'link_with' : udev_link_with,
|
||||
@ -123,19 +131,25 @@ udev_plugin_template = executable_template + {
|
||||
'install_dir' : udevlibexecdir,
|
||||
}
|
||||
|
||||
udev_common_template = {
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libudevd_core,
|
||||
],
|
||||
'dependencies' : [
|
||||
libacl,
|
||||
threads,
|
||||
],
|
||||
}
|
||||
udev_test_template = test_template + udev_common_template
|
||||
|
||||
executables += [
|
||||
executable_template + {
|
||||
'name' : 'udevadm',
|
||||
'public' : true,
|
||||
'sources' : udevadm_sources,
|
||||
'link_with' : [libudevd_core],
|
||||
'dependencies' : [
|
||||
libacl,
|
||||
libblkid,
|
||||
libidn,
|
||||
libkmod,
|
||||
threads,
|
||||
],
|
||||
'dependencies' : udev_dependencies,
|
||||
'install_rpath' : udev_rpath,
|
||||
},
|
||||
udev_plugin_template + {
|
||||
@ -180,6 +194,38 @@ executables += [
|
||||
'name' : 'v4l_id',
|
||||
'sources' : files('v4l_id/v4l_id.c'),
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'fido_id/test-fido-id-desc.c',
|
||||
'fido_id/fido_id_desc.c',
|
||||
),
|
||||
'suite' : 'udev',
|
||||
},
|
||||
udev_test_template + {
|
||||
'sources' : files('test-udev-builtin.c'),
|
||||
},
|
||||
udev_test_template + {
|
||||
'sources' : files('test-udev-format.c'),
|
||||
},
|
||||
udev_test_template + {
|
||||
'sources' : files('test-udev-manager.c'),
|
||||
},
|
||||
udev_test_template + {
|
||||
'sources' : files('test-udev-node.c'),
|
||||
},
|
||||
udev_test_template + {
|
||||
'sources' : files('test-udev-rule-runner.c'),
|
||||
'dependencies' : udev_dependencies + [
|
||||
libselinux,
|
||||
],
|
||||
'type' : 'manual',
|
||||
},
|
||||
udev_test_template + {
|
||||
'sources' : files('test-udev-rules.c'),
|
||||
},
|
||||
udev_test_template + {
|
||||
'sources' : files('test-udev-spawn.c'),
|
||||
},
|
||||
]
|
||||
|
||||
meson.add_install_script(meson_make_symlink,
|
||||
@ -233,58 +279,3 @@ fuzzers += [
|
||||
),
|
||||
},
|
||||
]
|
||||
|
||||
test_libudev_base = {
|
||||
'link_with' : [libudevd_core, libshared],
|
||||
'dependencies' : [threads, libacl],
|
||||
}
|
||||
|
||||
tests += [
|
||||
{
|
||||
'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-format.c'),
|
||||
'base' : test_libudev_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-udev-manager.c'),
|
||||
'base' : test_libudev_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-udev-node.c'),
|
||||
'base' : test_libudev_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-udev-rule-runner.c'),
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libudevd_core,
|
||||
],
|
||||
'dependencies' : [
|
||||
libacl,
|
||||
libblkid,
|
||||
libkmod,
|
||||
librt,
|
||||
libselinux,
|
||||
threads,
|
||||
],
|
||||
'includes' : udev_includes,
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
'sources' : files('test-udev-rules.c'),
|
||||
'base' : test_libudev_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-udev-spawn.c'),
|
||||
'base' : test_libudev_base,
|
||||
},
|
||||
]
|
||||
|
@ -17,10 +17,7 @@ executables += [
|
||||
'conditions' : ['ENABLE_XDG_AUTOSTART'],
|
||||
'sources' : files('xdg-autostart-condition.c'),
|
||||
},
|
||||
]
|
||||
|
||||
tests += [
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-xdg-autostart.c',
|
||||
'xdg-autostart-service.c',
|
||||
|
@ -229,7 +229,15 @@ endif
|
||||
|
||||
sys_script_py = files('sys-script.py')
|
||||
test_udev_py = files('test-udev.py')
|
||||
|
||||
if want_tests != 'false'
|
||||
exe = executables_by_name.get('test-udev-rule-runner')
|
||||
test('test-udev',
|
||||
test_udev_py,
|
||||
args : ['-v'],
|
||||
env : ['UDEV_RULE_RUNNER=' + exe.full_path()],
|
||||
depends : exe,
|
||||
timeout : 180)
|
||||
endif
|
||||
if install_tests
|
||||
install_data(
|
||||
sys_script_py,
|
||||
|
Loading…
Reference in New Issue
Block a user