summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/meson.build28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/meson.build b/tests/meson.build
index 2c7f799f..39395bae 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -90,3 +90,31 @@ foreach test : integration_tests
],
)
endforeach
+
+########
+# Lint #
+########
+
+if get_option('lint')
+ if not meson.is_subproject()
+ # Check code with cppcheck
+ cppcheck = find_program('cppcheck', required: false)
+ if cppcheck.found()
+ compdb_path = join_paths(ingen_build_root, 'compile_commands.json')
+ suppress_path = join_paths(ingen_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',
+ timeout: 60,
+ )
+ endif
+ endif
+endif