summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.clang-format4
-rw-r--r--include/raul/Semaphore.hpp2
-rw-r--r--test/meson.build29
3 files changed, 32 insertions, 3 deletions
diff --git a/.clang-format b/.clang-format
index 9b91735..55ba656 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,10 +1,10 @@
-# Copyright 2021-2022 David Robillard <d@drobilla.net>
+# Copyright 2021-2024 David Robillard <d@drobilla.net>
# SPDX-License-Identifier: 0BSD OR GPL-3.0-or-later
---
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
-AlignEscapedNewlinesLeft: true
+AlignEscapedNewlines: Left
BasedOnStyle: Mozilla
BraceWrapping:
AfterNamespace: false
diff --git a/include/raul/Semaphore.hpp b/include/raul/Semaphore.hpp
index 75d0a62..c9ce024 100644
--- a/include/raul/Semaphore.hpp
+++ b/include/raul/Semaphore.hpp
@@ -252,7 +252,7 @@ Semaphore::timed_wait(const std::chrono::duration<Rep, Period>& wait)
const auto now(chr::seconds(time.tv_sec) + chr::nanoseconds(time.tv_nsec));
const auto end(now + wait);
- const chr::seconds end_sec(chr::duration_cast<chr::seconds>(end));
+ const chr::seconds end_sec(chr::duration_cast<chr::seconds>(end));
const chr::nanoseconds end_nsec(end - end_sec);
const timespec ts_end = {static_cast<time_t>(end_sec.count()),
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
###################