1
0
mirror of https://github.com/systemd/systemd synced 2024-07-08 20:15:55 +00:00

meson: Use meson test suite feature

This makes it easier to only test a subset of tests without having
to specify them all on the command line:
    meson test -C build --suite headers
This commit is contained in:
Jan Janssen 2022-05-02 11:12:34 +02:00
parent 911c15087c
commit 14056a52c6
5 changed files with 13 additions and 0 deletions

View File

@ -61,6 +61,7 @@ if conf.get('ENABLE_HWDB') == 1
parse_hwdb_py = find_program('parse_hwdb.py')
test('parse-hwdb',
parse_hwdb_py,
suite : 'dist-check',
args : [hwdb_files_test,
auto_suspend_rules],
timeout : 90)

View File

@ -226,6 +226,7 @@ update_dbus_docs = custom_target(
if conf.get('BUILD_MODE_DEVELOPER') == 1
test('dbus-docs-fresh',
update_dbus_docs_py,
suite : 'dist-check',
args : ['--build-dir', project_build_root, '--test', dbus_docs],
depends : dbus_programs)
endif

View File

@ -3518,6 +3518,7 @@ if conf.get('ENABLE_HWDB') == 1
if want_tests != 'false'
test('hwdb-test',
hwdb_test_sh,
suite : 'dist-check',
args : [systemd_hwdb.full_path()],
timeout : 90)
endif
@ -3878,6 +3879,7 @@ foreach tuple : fuzzers
if b == name
test('@0@_@1@'.format(b, c),
exe,
suite : 'fuzzers',
args : [project_source_root / p])
endif
endforeach
@ -3940,6 +3942,7 @@ jekyll = find_program('jekyll', required : false)
if get_option('mode') == 'developer' and want_tests != 'false' and jekyll.found()
test('github-pages',
jekyll,
suite : 'dist-check',
args : ['build',
'--source', project_source_root / 'docs',
'--destination', project_build_root / '_site'])
@ -3955,11 +3958,13 @@ foreach exec : public_programs
if want_tests != 'false'
test('check-help-' + name,
check_help,
suite : 'dist-check',
args : exec.full_path(),
depends: exec)
test('check-version-' + name,
check_version,
suite : 'dist-check',
args : [exec.full_path(),
meson.project_version()],
depends: exec)
@ -3973,6 +3978,7 @@ check_directives_sh = find_program('tools/check-directives.sh')
if want_tests != 'false'
test('check-directives',
check_directives_sh,
suite : 'dist-check',
args : [project_source_root, project_build_root])
endif
@ -4012,6 +4018,7 @@ foreach tuple : sanitizers
if fuzz_tests
test('@0@_@1@_@2@'.format(b, c, sanitizer),
env,
suite : 'fuzz+san',
env : ['UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1'],
timeout : 60,
args : [exe.full_path(),

View File

@ -79,6 +79,7 @@ foreach header : _systemd_headers + _not_installed_headers + [libudev_h_path]
std_name = opt.length() == 2 ? '_'.join(opt[1].split(':')) : ''
test('cc-' + header.split('/')[-1] + '_' + opt[0] + std_name,
env,
suite : 'headers',
args : [cc.cmd_array(),
'-c',
'-x', opt,

View File

@ -112,6 +112,7 @@ rule_syntax_check_py = find_program('rule-syntax-check.py')
if want_tests != 'false'
test('rule-syntax-check',
rule_syntax_check_py,
suite : 'dist-check',
args : all_rules)
endif
@ -162,6 +163,7 @@ if rpm.found() and rpmspec.found()
if want_tests != 'false'
test('test-rpm-macros',
test_rpm_macros,
suite : 'dist-check',
args : [project_build_root])
endif
else
@ -191,6 +193,7 @@ if want_tests != 'false' and dmi_arches.contains(host_machine.cpu_family())
test(name,
udev_dmi_memory_id_test,
suite : 'dist-check',
args : [udev_prog_paths['dmi_memory_id'].full_path(),
source,
source + '.txt'],