aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-09-27 19:12:44 -0400
committerDavid Robillard <d@drobilla.net>2024-09-28 11:08:21 -0400
commit4256d4693dfbdc9b69cb010832a0d8a463d590b4 (patch)
treea13e741ea8e24f9f0619f5ddcc0e0f20fa4c51a2 /test
parentf0b4f46f6168968c92ca615f4cbb2f966005c779 (diff)
downloadserd-4256d4693dfbdc9b69cb010832a0d8a463d590b4.tar.gz
serd-4256d4693dfbdc9b69cb010832a0d8a463d590b4.tar.bz2
serd-4256d4693dfbdc9b69cb010832a0d8a463d590b4.zip
Add clang-format lint test
Diffstat (limited to 'test')
-rw-r--r--test/meson.build11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/meson.build b/test/meson.build
index 530c0d13..771158b1 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -61,6 +61,17 @@ if get_option('lint')
)
endif
+ # Check code formatting
+ clang_format = find_program('clang-format', required: false)
+ if clang_format.found()
+ test(
+ 'format',
+ clang_format,
+ args: ['--Werror', '--dry-run'] + c_headers + sources,
+ suite: 'code',
+ )
+ endif
+
# Check code with cppcheck
if not meson.is_subproject()
cppcheck = find_program('cppcheck', required: false)