summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-09-29 10:52:48 -0400
committerDavid Robillard <d@drobilla.net>2024-10-11 18:51:19 -0400
commit41c3445f41764acffa34cfc2ab10efccd8f0cfeb (patch)
treecbdf2ee0a772b38eff59255b62b54582be990330 /test
parent837179db6484241cebfb64ec7cf929cc58b7a42a (diff)
downloadraul-41c3445f41764acffa34cfc2ab10efccd8f0cfeb.tar.gz
raul-41c3445f41764acffa34cfc2ab10efccd8f0cfeb.tar.bz2
raul-41c3445f41764acffa34cfc2ab10efccd8f0cfeb.zip
Fix whitespace and add clang-format test
Diffstat (limited to 'test')
-rw-r--r--test/meson.build29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/meson.build b/test/meson.build
index e319a9d..599e53e 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -1,6 +1,24 @@
# Copyright 2019-2022 David Robillard <d@drobilla.net>
# SPDX-License-Identifier: 0BSD OR GPL-3.0-or-later
+########
+# Lint #
+########
+
+test_sources = files(
+ 'headers/test_headers.cpp',
+ 'array_test.cpp',
+ 'build_test.cpp',
+ 'double_buffer_test.cpp',
+ 'maid_test.cpp',
+ 'path_test.cpp',
+ 'ringbuffer_test.cpp',
+ 'sem_test.cpp',
+ 'socket_test.cpp',
+ 'symbol_test.cpp',
+ 'thread_test.cpp',
+)
+
if get_option('lint')
if not meson.is_subproject()
# Check release metadata
@@ -25,6 +43,17 @@ if get_option('lint')
suite: 'data',
)
endif
+
+ # Check code formatting
+ clang_format = find_program('clang-format', required: false)
+ if clang_format.found()
+ test(
+ 'format',
+ clang_format,
+ args: ['--Werror', '--dry-run'] + headers + test_sources,
+ suite: 'code',
+ )
+ endif
endif
###################