summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2022-05-05 01:53:28 +0300
committerGitHub <noreply@github.com>2022-05-05 01:53:28 +0300
commit51cef2b56f29d1c673fb1c1dad7aa7ceac19d94d (patch)
tree3bbde5a28b6997497be6bff96fbc44b4cb3e2f4c
parent746ea80b77cc8fd671f4ee7a3aab5cff1c973d6d (diff)
parentee8052c1370fae6868a346e1751ae90cbd70ca92 (diff)
downloadsystemd-51cef2b56f29d1c673fb1c1dad7aa7ceac19d94d.tar.gz
Merge pull request #23246 from medhefgo/check-compilation
meson: Improve public header tests
-rw-r--r--hwdb.d/meson.build1
-rw-r--r--man/meson.build1
-rw-r--r--meson.build8
-rw-r--r--src/systemd/meson.build24
-rw-r--r--test/meson.build3
-rwxr-xr-xtools/check-compilation.sh5
6 files changed, 28 insertions, 14 deletions
diff --git a/hwdb.d/meson.build b/hwdb.d/meson.build
index b4c519c8fd..90b71916b7 100644
--- a/hwdb.d/meson.build
+++ b/hwdb.d/meson.build
@@ -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)
diff --git a/man/meson.build b/man/meson.build
index d9c706b4ab..b7725ce5f0 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -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
diff --git a/meson.build b/meson.build
index 582e33c9a7..a3f9e3b92d 100644
--- a/meson.build
+++ b/meson.build
@@ -289,7 +289,6 @@ conf.set_quoted('STATUS_UNIT_FORMAT_DEFAULT_STR', status_unit_format
cc = meson.get_compiler('c')
pkgconfig = import('pkgconfig')
-check_compilation_sh = find_program('tools/check-compilation.sh')
meson_build_sh = find_program('tools/meson-build.sh')
want_tests = get_option('tests')
@@ -3519,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
@@ -3879,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
@@ -3941,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'])
@@ -3956,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)
@@ -3974,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
@@ -4013,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(),
diff --git a/src/systemd/meson.build b/src/systemd/meson.build
index 9faee53db9..10a67efbd1 100644
--- a/src/systemd/meson.build
+++ b/src/systemd/meson.build
@@ -46,6 +46,10 @@ install_headers(
############################################################
+if want_tests == 'false'
+ subdir_done()
+endif
+
opts = [['c'],
['c', '-ansi'],
['c', '-std=iso9899:1990'],
@@ -73,13 +77,17 @@ endif
foreach header : _systemd_headers + _not_installed_headers + [libudev_h_path]
foreach opt : opts
std_name = opt.length() == 2 ? '_'.join(opt[1].split(':')) : ''
- name = ''.join(['cc-', header.split('/')[-1], '_', opt[0], std_name])
- if want_tests != 'false'
- test(name,
- check_compilation_sh,
- args : cc.cmd_array() + ['-c', '-x'] + opt +
- ['-Werror', '-include',
- meson.current_source_dir() / header])
- endif
+ test('cc-' + header.split('/')[-1] + '_' + opt[0] + std_name,
+ env,
+ suite : 'headers',
+ args : [cc.cmd_array(),
+ '-c',
+ '-x', opt,
+ '-Wall',
+ '-Wextra',
+ '-Werror',
+ '-include', meson.current_source_dir() / header,
+ '-o/dev/null',
+ '/dev/null'])
endforeach
endforeach
diff --git a/test/meson.build b/test/meson.build
index 34f78d5c62..f2e4ee0967 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -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'],
diff --git a/tools/check-compilation.sh b/tools/check-compilation.sh
deleted file mode 100755
index c2fe3aa5c1..0000000000
--- a/tools/check-compilation.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: LGPL-2.1-or-later
-set -eu
-
-"$@" '-' -o/dev/null </dev/null