From ce5688253e1ef06cd9551f563f70aab2cd487197 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 6 Oct 2024 13:39:24 -0400 Subject: Add cppcheck lint test --- test/meson.build | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/meson.build b/test/meson.build index 337f26d..1e8b08f 100644 --- a/test/meson.build +++ b/test/meson.build @@ -38,6 +38,20 @@ if get_option('lint') if autoship.found() test('autoship', autoship, args: ['test', sratom_src_root], suite: 'data') endif + + # Check code with cppcheck + cppcheck = find_program('cppcheck', required: false) + if cppcheck.found() + compdb_path = join_paths(sratom_build_root, 'compile_commands.json') + cppcheck_args = [ + '--enable=warning,style,performance,portability', + '--error-exitcode=1', + '--project=' + compdb_path, + '--suppress=normalCheckLevelMaxBranches', + '-q', + ] + test('cppcheck', cppcheck, args: cppcheck_args, suite: 'code') + endif endif # Check licensing metadata -- cgit v1.2.1