diff options
author | David Robillard <d@drobilla.net> | 2024-09-29 19:23:42 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-10-12 14:07:10 -0400 |
commit | 54563d41caf66556978e6ffd37738126499c6e90 (patch) | |
tree | c1346a07835e36c9cde53a6da3fa30e28e3bd7c7 | |
parent | 18d6eb5850c7c34d5b6b05034b7392115931684d (diff) | |
download | jalv-54563d41caf66556978e6ffd37738126499c6e90.tar.gz jalv-54563d41caf66556978e6ffd37738126499c6e90.tar.bz2 jalv-54563d41caf66556978e6ffd37738126499c6e90.zip |
Add cppcheck test
-rw-r--r-- | .reuse/dep5 | 2 | ||||
-rw-r--r-- | .suppress.cppcheck | 12 | ||||
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | meson.build | 1 | ||||
-rw-r--r-- | test/meson.build | 20 |
5 files changed, 36 insertions, 2 deletions
diff --git a/.reuse/dep5 b/.reuse/dep5 index bd156e8..5888ff3 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -3,7 +3,7 @@ Upstream-Name: jalv Upstream-Contact: David Robillard <d@drobilla.net> Source: https://gitlab.com/drobilla/jalv -Files: .clang* .clant.json .gitignore .includes.imp AUTHORS NEWS jalv.desktop.in jalv.ttl +Files: .clang* .clant.json .gitignore .includes.imp .suppress.cppcheck AUTHORS NEWS jalv.desktop.in jalv.ttl Copyright: 2010-2022 David Robillard <d@drobilla.net> License: 0BSD OR ISC diff --git a/.suppress.cppcheck b/.suppress.cppcheck new file mode 100644 index 0000000..cf2c1b7 --- /dev/null +++ b/.suppress.cppcheck @@ -0,0 +1,12 @@ +constParameterCallback +constParameterPointer +constVariablePointer +cstyleCast +invalidscanf +knownConditionTrueFalse +memleakOnRealloc +normalCheckLevelMaxBranches +uninitvar +unreadVariable +unusedStructMember +variableScope @@ -4,6 +4,7 @@ jalv (1.6.9) unstable; urgency=medium * Add missing short versions of command line options * Add option to install tool man pages * Build Qt UI with -fPIC + * Clean up and strengthen code * Clean up command line help output * Fix clashing command line options * Fix minor memory leaks @@ -12,7 +13,7 @@ jalv (1.6.9) unstable; urgency=medium * Switch to external zix dependency * Use Gtk switches instead of checkboxes for toggle controls - -- David Robillard <d@drobilla.net> Sat, 13 Jul 2024 00:46:42 +0000 + -- David Robillard <d@drobilla.net> Mon, 30 Sep 2024 02:14:07 +0000 jalv (1.6.8) stable; urgency=medium diff --git a/meson.build b/meson.build index 83cc36d..70fbbc3 100644 --- a/meson.build +++ b/meson.build @@ -16,6 +16,7 @@ project( ) jalv_src_root = meson.current_source_dir() +jalv_build_root = meson.current_build_dir() major_version = meson.project_version().split('.')[0] version_suffix = '@0@-@1@'.format(meson.project_name(), major_version) diff --git a/test/meson.build b/test/meson.build index 43083cf..951d4a1 100644 --- a/test/meson.build +++ b/test/meson.build @@ -44,6 +44,26 @@ if get_option('lint') suite: 'data', ) endif + + # Check code with cppcheck + cppcheck = find_program('cppcheck', required: false) + if cppcheck.found() + compdb_path = join_paths(jalv_build_root, 'compile_commands.json') + suppress_path = join_paths(jalv_src_root, '.suppress.cppcheck') + test( + 'cppcheck', + cppcheck, + args: [ + '--enable=warning,style,performance,portability', + '--error-exitcode=1', + '--project=' + compdb_path, + '--suppressions-list=' + suppress_path, + '-q', + ['-i', jalv_build_root], + ], + suite: 'code', + ) + endif endif # Check licensing metadata |