summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/meson.build28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/meson.build b/test/meson.build
index 2ef815e..128bf0b 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -34,6 +34,34 @@ if not meson.is_subproject() and get_option('lint')
suite: 'code',
)
endif
+
+ # Check code with cppcheck
+ if not meson.is_subproject()
+ cppcheck = find_program('cppcheck', required: false)
+ if cppcheck.found()
+ compdb_path = join_paths(zix_build_root, 'compile_commands.json')
+ test(
+ 'cppcheck',
+ cppcheck,
+ args: [
+ '--check-level=exhaustive',
+ '--enable=warning,style,performance,portability',
+ '--error-exitcode=1',
+ '--project=' + compdb_path,
+ '--suppress=assertWithSideEffect',
+ '--suppress=constParameterCallback',
+ '--suppress=constParameterPointer',
+ '--suppress=constVariablePointer',
+ '--suppress=invalidPrintfArgType_uint',
+ '--suppress=knownConditionTrueFalse',
+ '--suppress=selfAssignment',
+ '--suppress=unreadVariable',
+ '-q',
+ ],
+ suite: 'code',
+ )
+ endif
+ endif
endif
# Set warning suppression flags specific to tests