aboutsummaryrefslogtreecommitdiffstats
path: root/test/meson.build
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-09-27 19:12:06 -0400
committerDavid Robillard <d@drobilla.net>2024-09-28 11:08:21 -0400
commitf0b4f46f6168968c92ca615f4cbb2f966005c779 (patch)
treef4be542d2eab37b3ac603d94d986eb2bf115cf79 /test/meson.build
parent51a4acc55b233658501eacdcaf88c1f9917e0576 (diff)
downloadserd-f0b4f46f6168968c92ca615f4cbb2f966005c779.tar.gz
serd-f0b4f46f6168968c92ca615f4cbb2f966005c779.tar.bz2
serd-f0b4f46f6168968c92ca615f4cbb2f966005c779.zip
Add cppcheck lint test
Diffstat (limited to 'test/meson.build')
-rw-r--r--test/meson.build21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/meson.build b/test/meson.build
index 33f86dfb..530c0d13 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -61,6 +61,27 @@ if get_option('lint')
)
endif
+ # Check code with cppcheck
+ if not meson.is_subproject()
+ cppcheck = find_program('cppcheck', required: false)
+ if cppcheck.found()
+ compdb_path = join_paths(serd_build_root, 'compile_commands.json')
+ suppress_path = join_paths(serd_src_root, '.suppress.cppcheck')
+ test(
+ 'cppcheck',
+ cppcheck,
+ args: [
+ '--enable=warning,style,performance,portability',
+ '--error-exitcode=1',
+ '--project=' + compdb_path,
+ '--suppressions-list=' + suppress_path,
+ '-q',
+ ],
+ suite: 'code',
+ )
+ endif
+ endif
+
# Check script formatting
black = find_program('black', required: false)
if black.found()