diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/headers/.clang-tidy | 13 | ||||
-rw-r--r-- | test/headers/meson.build | 27 | ||||
-rw-r--r-- | test/headers/test_headers.c | 13 |
3 files changed, 53 insertions, 0 deletions
diff --git a/test/headers/.clang-tidy b/test/headers/.clang-tidy new file mode 100644 index 0000000..c0f1613 --- /dev/null +++ b/test/headers/.clang-tidy @@ -0,0 +1,13 @@ +# Copyright 2020-2025 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: 0BSD OR ISC + +Checks: > + *, + -altera-*, + -llvmlibc-*, +CheckOptions: + - key: readability-function-cognitive-complexity.Threshold + value: '0' +WarningsAsErrors: '*' +HeaderFilterRegex: '.*' +FormatStyle: file diff --git a/test/headers/meson.build b/test/headers/meson.build new file mode 100644 index 0000000..191159c --- /dev/null +++ b/test/headers/meson.build @@ -0,0 +1,27 @@ +# Copyright 2020-2025 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: 0BSD OR ISC + +header_c_suppressions = [] + +if get_option('warning_level') == 'everything' + if cc.get_id() == 'clang' + if not meson.is_cross_build() + header_c_suppressions += ['-Wno-poison-system-directories'] + endif + endif +endif + +if cc.get_id() == 'clang' + header_c_suppressions += ['-Wno-nullability-extension'] +endif + +test( + 'headers', + executable( + 'test_headers', + files('test_headers.c'), + c_args: header_c_suppressions, + dependencies: suil_dep, + ), + suite: 'unit', +) diff --git a/test/headers/test_headers.c b/test/headers/test_headers.c new file mode 100644 index 0000000..f79c9c6 --- /dev/null +++ b/test/headers/test_headers.c @@ -0,0 +1,13 @@ +// Copyright 2022-2025 David Robillard <d@drobilla.net> +// SPDX-License-Identifier: ISC + +#include <suil/suil.h> // IWYU pragma: keep + +#if defined(__GNUC__) +__attribute__((const)) +#endif +int +main(void) +{ + return 0; +} |