From 41c3445f41764acffa34cfc2ab10efccd8f0cfeb Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 29 Sep 2024 10:52:48 -0400 Subject: Fix whitespace and add clang-format test --- test/meson.build | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'test') 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 # 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 ################### -- cgit v1.2.1