From aad5574b4d52f0f02ed1ec3d8f1e12227176a98e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 22 Jun 2024 18:46:19 -0400 Subject: Fix whitespace and add code formatting test --- test/meson.build | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/meson.build b/test/meson.build index 15f449c..2ef815e 100644 --- a/test/meson.build +++ b/test/meson.build @@ -23,6 +23,17 @@ if not meson.is_subproject() and 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'] + c_headers + sources, + suite: 'code', + ) + endif endif # Set warning suppression flags specific to tests @@ -103,7 +114,7 @@ foreach test, cases : sequential_tests endforeach endforeach -# Test multi-threaded +# Test multi-threaded if thread_dep.found() foreach test, cases : threaded_tests sources = common_test_sources + files('test_@0@.c'.format(test)) -- cgit v1.2.1