diff options
author | David Robillard <d@drobilla.net> | 2025-01-10 11:38:29 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2025-01-10 11:38:29 -0500 |
commit | 4baaec4c204f5098358469a2b082897047593092 (patch) | |
tree | bb3099d686356e11ee0b949d741f69b03d1eba1f | |
parent | 7243389db613a8eabd804cb1a1da1cb0aaf81130 (diff) | |
download | lilv-main.tar.gz lilv-main.tar.bz2 lilv-main.zip |
This allows for better analysis, and adds a cache to improve checking times,
especially on repeated runs.
-rw-r--r-- | test/lint/meson.build | 38 | ||||
-rw-r--r-- | test/meson.build | 35 |
2 files changed, 39 insertions, 34 deletions
diff --git a/test/lint/meson.build b/test/lint/meson.build new file mode 100644 index 0000000..04214f1 --- /dev/null +++ b/test/lint/meson.build @@ -0,0 +1,38 @@ +# Copyright 2020-2024 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: 0BSD OR ISC + +# Check licensing metadata +reuse = find_program('reuse', required: false) +if reuse.found() + reuse_args = ['--root', lilv_src_root, 'lint'] + test('REUSE', reuse, args: reuse_args, suite: 'data') +endif + +if not meson.is_subproject() + # Check release metadata + autoship = find_program('autoship', required: false) + if autoship.found() + test('autoship', autoship, args: ['test', lilv_src_root], suite: 'data') + endif + + # Check code with cppcheck + cppcheck = find_program('cppcheck', required: false) + if cppcheck.found() + compdb_path = join_paths(lilv_build_root, 'compile_commands.json') + suppress_path = join_paths(lilv_src_root, '.suppress.cppcheck') + test( + 'cppcheck', + cppcheck, + args: [ + '--cppcheck-build-dir=' + meson.current_build_dir(), + '--enable=warning,style,performance,portability', + '--error-exitcode=1', + '--project=' + compdb_path, + '--suppressions-list=' + suppress_path, + '-DLILV_VERSION="\"@0@\""'.format(meson.project_version()), + '-q', + ], + suite: 'code', + ) + endif +endif diff --git a/test/meson.build b/test/meson.build index 1780bab..e260f37 100644 --- a/test/meson.build +++ b/test/meson.build @@ -92,38 +92,5 @@ endforeach ######## if get_option('lint') - if not meson.is_subproject() - # Check release metadata - autoship = find_program('autoship', required: false) - if autoship.found() - test('autoship', autoship, args: ['test', lilv_src_root], suite: 'data') - endif - - # Check code with cppcheck - cppcheck = find_program('cppcheck', required: false) - if cppcheck.found() - compdb_path = join_paths(lilv_build_root, 'compile_commands.json') - suppress_path = join_paths(lilv_src_root, '.suppress.cppcheck') - test( - 'cppcheck', - cppcheck, - args: [ - '--enable=warning,style,performance,portability', - '--error-exitcode=1', - '--project=' + compdb_path, - '--suppressions-list=' + suppress_path, - '-DLILV_VERSION="\"@0@\""'.format(meson.project_version()), - '-q', - ], - suite: 'code', - ) - endif - endif - - # Check licensing metadata - reuse = find_program('reuse', required: false) - if reuse.found() - reuse_args = ['--root', lilv_src_root, 'lint'] - test('REUSE', reuse, args: reuse_args, suite: 'data') - endif + subdir('lint') endif |