summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-10-06 15:59:55 -0400
committerDavid Robillard <d@drobilla.net>2024-10-06 18:40:01 -0400
commite6292a8aaef1ec0ae74ef083351369203e687954 (patch)
treeb3fe2a4ce71ed880d43599a98e75def62d201bdd /tests
parent8f836e88392d534c1f692d748228dae6bc542ca0 (diff)
downloadingen-e6292a8aaef1ec0ae74ef083351369203e687954.tar.gz
ingen-e6292a8aaef1ec0ae74ef083351369203e687954.tar.bz2
ingen-e6292a8aaef1ec0ae74ef083351369203e687954.zip
Add lint option and cppcheck test
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