diff options
author | David Robillard <d@drobilla.net> | 2022-07-14 11:50:43 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-07-18 20:18:28 -0400 |
commit | 55dc97a32eeeb42012ce1e7d28ed99ea537f4d2f (patch) | |
tree | c0fc78d78609c1bd3e880499bd0e80a4498b0be3 /test | |
parent | 891f4044c92117517041c9e7ee4099b75bd493da (diff) | |
download | lilv-55dc97a32eeeb42012ce1e7d28ed99ea537f4d2f.tar.gz lilv-55dc97a32eeeb42012ce1e7d28ed99ea537f4d2f.tar.bz2 lilv-55dc97a32eeeb42012ce1e7d28ed99ea537f4d2f.zip |
Switch to meson build system
Diffstat (limited to 'test')
22 files changed, 371 insertions, 14 deletions
diff --git a/test/bad_syntax.lv2/meson.build b/test/bad_syntax.lv2/meson.build new file mode 100644 index 0000000..f50b43d --- /dev/null +++ b/test/bad_syntax.lv2/meson.build @@ -0,0 +1,25 @@ +module = shared_module('bad_syntax', + files('bad_syntax.c'), + c_args: c_suppressions, + dependencies: lv2_dep, + gnu_symbol_visibility: 'hidden', + name_prefix: '') + +extension = '.' + module.full_path().split('.')[-1] +config = configuration_data({'SHLIB_EXT': extension}) +ttl_files = ['manifest.ttl', 'bad_syntax.ttl'] + +foreach f : ttl_files + configure_file(input: files(f + '.in'), + output: f, + configuration: config) +endforeach + +test('bad_syntax', + executable('test_bad_syntax', + files('test_bad_syntax.c'), + c_args: c_suppressions + test_args, + dependencies: [lv2_dep, lilv_static_dep]), + args: [meson.current_build_dir() / ''], + suite: 'plugin') + diff --git a/test/failed_instantiation.lv2/meson.build b/test/failed_instantiation.lv2/meson.build new file mode 100644 index 0000000..8e95549 --- /dev/null +++ b/test/failed_instantiation.lv2/meson.build @@ -0,0 +1,25 @@ +module = shared_module('failed_instantiation', + files('failed_instantiation.c'), + c_args: c_suppressions, + dependencies: lv2_dep, + gnu_symbol_visibility: 'hidden', + name_prefix: '') + +extension = '.' + module.full_path().split('.')[-1] +config = configuration_data({'SHLIB_EXT': extension}) +ttl_files = ['manifest.ttl', 'failed_instantiation.ttl'] + +foreach f : ttl_files + configure_file(input: files(f + '.in'), + output: f, + configuration: config) +endforeach + +test('failed_instantiation', + executable('test_failed_instantiation', + files('test_failed_instantiation.c'), + c_args: c_suppressions + test_args, + dependencies: [lv2_dep, lilv_static_dep]), + args: [meson.current_build_dir() / ''], + suite: 'plugin') + diff --git a/test/failed_lib_descriptor.lv2/meson.build b/test/failed_lib_descriptor.lv2/meson.build new file mode 100644 index 0000000..e4e9d76 --- /dev/null +++ b/test/failed_lib_descriptor.lv2/meson.build @@ -0,0 +1,25 @@ +module = shared_module('failed_lib_descriptor', + files('failed_lib_descriptor.c'), + c_args: c_suppressions, + dependencies: lv2_dep, + gnu_symbol_visibility: 'hidden', + name_prefix: '') + +extension = '.' + module.full_path().split('.')[-1] +config = configuration_data({'SHLIB_EXT': extension}) +ttl_files = ['manifest.ttl', 'failed_lib_descriptor.ttl'] + +foreach f : ttl_files + configure_file(input: files(f + '.in'), + output: f, + configuration: config) +endforeach + +test('failed_lib_descriptor', + executable('test_failed_lib_descriptor', + files('test_failed_lib_descriptor.c'), + c_args: c_suppressions + test_args, + dependencies: [lv2_dep, lilv_static_dep]), + args: [meson.current_build_dir() / ''], + suite: 'plugin') + diff --git a/test/lib_descriptor.lv2/meson.build b/test/lib_descriptor.lv2/meson.build new file mode 100644 index 0000000..5a85fe5 --- /dev/null +++ b/test/lib_descriptor.lv2/meson.build @@ -0,0 +1,25 @@ +module = shared_module('lib_descriptor', + files('lib_descriptor.c'), + c_args: c_suppressions, + dependencies: lv2_dep, + gnu_symbol_visibility: 'hidden', + name_prefix: '') + +extension = '.' + module.full_path().split('.')[-1] +config = configuration_data({'SHLIB_EXT': extension}) +ttl_files = ['manifest.ttl', 'lib_descriptor.ttl'] + +foreach f : ttl_files + configure_file(input: files(f + '.in'), + output: f, + configuration: config) +endforeach + +test('lib_descriptor', + executable('test_lib_descriptor', + files('test_lib_descriptor.c'), + c_args: c_suppressions + test_args, + dependencies: [lv2_dep, lilv_static_dep]), + args: [meson.current_build_dir() / ''], + suite: 'plugin') + diff --git a/test/lilv_test_uri_map.h b/test/lilv_test_uri_map.h index 5f85c86..88c9107 100644 --- a/test/lilv_test_uri_map.h +++ b/test/lilv_test_uri_map.h @@ -23,14 +23,13 @@ #include "serd/serd.h" #include <assert.h> -#include <stddef.h> #include <stdint.h> #include <stdlib.h> #include <string.h> typedef struct { - char** uris; - size_t n_uris; + char** uris; + uint32_t n_uris; } LilvTestUriMap; static inline void @@ -43,7 +42,7 @@ lilv_test_uri_map_init(LilvTestUriMap* const map) static inline void lilv_test_uri_map_clear(LilvTestUriMap* const map) { - for (size_t i = 0; i < map->n_uris; ++i) { + for (uint32_t i = 0; i < map->n_uris; ++i) { free(map->uris[i]); } @@ -57,7 +56,7 @@ map_uri(LV2_URID_Map_Handle handle, const char* uri) { LilvTestUriMap* map = (LilvTestUriMap*)handle; - for (size_t i = 0; i < map->n_uris; ++i) { + for (uint32_t i = 0; i < map->n_uris; ++i) { if (!strcmp(map->uris[i], uri)) { return i + 1; } diff --git a/test/lilv_test_utils.c b/test/lilv_test_utils.c index f658f1b..941509a 100644 --- a/test/lilv_test_utils.c +++ b/test/lilv_test_utils.c @@ -14,8 +14,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define _POSIX_C_SOURCE 200809L /* for setenv */ - #include "lilv_test_utils.h" #include "../src/filesystem.h" @@ -47,7 +45,7 @@ lilv_test_env_new(void) // Set custom LV2_PATH in build directory to only use test data char* test_path = lilv_path_canonical(LILV_TEST_DIR); - char* lv2_path = lilv_strjoin(test_path, "/test_lv2_path", NULL); + char* lv2_path = lilv_strjoin(test_path, "/lv2", NULL); LilvNode* path = lilv_new_string(world, lv2_path); lilv_world_set_option(world, LILV_OPTION_LV2_PATH, path); free(lv2_path); diff --git a/test/core.lv2/lv2core.ttl b/test/lv2/core.lv2/lv2core.ttl index 5659487..5659487 100644 --- a/test/core.lv2/lv2core.ttl +++ b/test/lv2/core.lv2/lv2core.ttl diff --git a/test/core.lv2/manifest.ttl b/test/lv2/core.lv2/manifest.ttl index a77ad71..a77ad71 100644 --- a/test/core.lv2/manifest.ttl +++ b/test/lv2/core.lv2/manifest.ttl diff --git a/test/lv2/core.lv2/meson.build b/test/lv2/core.lv2/meson.build new file mode 100644 index 0000000..4ad7969 --- /dev/null +++ b/test/lv2/core.lv2/meson.build @@ -0,0 +1,8 @@ +ttl_files = files( + 'lv2core.ttl', + 'manifest.ttl', +) + +foreach file : ttl_files + configure_file(copy: true, input: file, output: '@PLAINNAME@') +endforeach diff --git a/test/meson.build b/test/meson.build new file mode 100644 index 0000000..22b316b --- /dev/null +++ b/test/meson.build @@ -0,0 +1,80 @@ +# Copyright 2020-2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 OR ISC + +# Check release metadata +autoship = find_program('autoship', required: false) +if autoship.found() + test('autoship', autoship, args: ['test', lilv_src_root], suite: 'data') +endif + +test_args = ['-DLILV_STATIC'] +if cc.get_id() == 'msvc' + test_args += [ + '/wd4464', # relative include path contains '..' + ] +endif + +subdir('lv2/core.lv2') + +################ +# Bundle Tests # +################ + +subdir('bad_syntax.lv2') +subdir('failed_instantiation.lv2') +subdir('failed_lib_descriptor.lv2') +subdir('lib_descriptor.lv2') +subdir('missing_descriptor.lv2') +subdir('missing_name.lv2') +subdir('missing_plugin.lv2') +subdir('missing_port.lv2') +subdir('missing_port_name.lv2') +subdir('new_version.lv2') +subdir('old_version.lv2') +subdir('test_plugin.lv2') + +############## +# Unit Tests # +############## + +unit_tests = [ + 'bad_port_index', + 'bad_port_symbol', + 'classes', + 'discovery', + 'filesystem', + 'get_symbol', + 'no_author', + 'no_verify', + 'plugin', + 'port', + 'preset', + 'project', + 'project_no_author', + 'prototype', + 'reload_bundle', + 'replace_version', + 'state', + 'string', + 'ui', + 'util', + 'value', + 'verify', + 'world', +] + +define_args = [ + '-DLILV_TEST_BUNDLE="@0@/"'.format(meson.current_build_dir() / 'test_plugin.lv2'), + '-DLILV_TEST_DIR="@0@/"'.format(meson.current_build_dir()), +] + +foreach unit : unit_tests + test(unit, + executable('test_@0@'.format(unit), + files('lilv_test_utils.c', 'test_@0@.c'.format(unit)), + c_args: define_args + test_args + c_suppressions, + include_directories: include_directories('../src'), + dependencies: [lv2_dep, lilv_static_dep]), + suite: 'unit') +endforeach + diff --git a/test/missing_descriptor.lv2/meson.build b/test/missing_descriptor.lv2/meson.build new file mode 100644 index 0000000..cf1d45c --- /dev/null +++ b/test/missing_descriptor.lv2/meson.build @@ -0,0 +1,25 @@ +module = shared_module('missing_descriptor', + files('missing_descriptor.c'), + c_args: c_suppressions, + dependencies: lv2_dep, + gnu_symbol_visibility: 'hidden', + name_prefix: '') + +extension = '.' + module.full_path().split('.')[-1] +config = configuration_data({'SHLIB_EXT': extension}) +ttl_files = ['manifest.ttl', 'missing_descriptor.ttl'] + +foreach f : ttl_files + configure_file(input: files(f + '.in'), + output: f, + configuration: config) +endforeach + +test('missing_descriptor', + executable('test_missing_descriptor', + files('test_missing_descriptor.c'), + c_args: c_suppressions + test_args, + dependencies: [lv2_dep, lilv_static_dep]), + args: [meson.current_build_dir() / ''], + suite: 'plugin') + diff --git a/test/missing_name.lv2/meson.build b/test/missing_name.lv2/meson.build new file mode 100644 index 0000000..3fe6ce4 --- /dev/null +++ b/test/missing_name.lv2/meson.build @@ -0,0 +1,25 @@ +module = shared_module('missing_name', + files('missing_name.c'), + c_args: c_suppressions, + dependencies: lv2_dep, + gnu_symbol_visibility: 'hidden', + name_prefix: '') + +extension = '.' + module.full_path().split('.')[-1] +config = configuration_data({'SHLIB_EXT': extension}) +ttl_files = ['manifest.ttl', 'missing_name.ttl'] + +foreach f : ttl_files + configure_file(input: files(f + '.in'), + output: f, + configuration: config) +endforeach + +test('missing_name', + executable('test_missing_name', + files('test_missing_name.c'), + c_args: c_suppressions + test_args, + dependencies: [lv2_dep, lilv_static_dep]), + args: [meson.current_build_dir() / ''], + suite: 'plugin') + diff --git a/test/missing_plugin.lv2/meson.build b/test/missing_plugin.lv2/meson.build new file mode 100644 index 0000000..ca6a8fe --- /dev/null +++ b/test/missing_plugin.lv2/meson.build @@ -0,0 +1,25 @@ +module = shared_module('missing_plugin', + files('missing_plugin.c'), + c_args: c_suppressions, + dependencies: lv2_dep, + gnu_symbol_visibility: 'hidden', + name_prefix: '') + +extension = '.' + module.full_path().split('.')[-1] +config = configuration_data({'SHLIB_EXT': extension}) +ttl_files = ['manifest.ttl', 'missing_plugin.ttl'] + +foreach f : ttl_files + configure_file(input: files(f + '.in'), + output: f, + configuration: config) +endforeach + +test('missing_plugin', + executable('test_missing_plugin', + files('test_missing_plugin.c'), + c_args: c_suppressions + test_args, + dependencies: [lv2_dep, lilv_static_dep]), + args: [meson.current_build_dir() / ''], + suite: 'plugin') + diff --git a/test/missing_port.lv2/meson.build b/test/missing_port.lv2/meson.build new file mode 100644 index 0000000..f497b8c --- /dev/null +++ b/test/missing_port.lv2/meson.build @@ -0,0 +1,25 @@ +module = shared_module('missing_port', + files('missing_port.c'), + c_args: c_suppressions, + dependencies: lv2_dep, + gnu_symbol_visibility: 'hidden', + name_prefix: '') + +extension = '.' + module.full_path().split('.')[-1] +config = configuration_data({'SHLIB_EXT': extension}) +ttl_files = ['manifest.ttl', 'missing_port.ttl'] + +foreach f : ttl_files + configure_file(input: files(f + '.in'), + output: f, + configuration: config) +endforeach + +test('missing_port', + executable('test_missing_port', + files('test_missing_port.c'), + c_args: c_suppressions + test_args, + dependencies: [lv2_dep, lilv_static_dep]), + args: [meson.current_build_dir() / ''], + suite: 'plugin') + diff --git a/test/missing_port_name.lv2/meson.build b/test/missing_port_name.lv2/meson.build new file mode 100644 index 0000000..07e7811 --- /dev/null +++ b/test/missing_port_name.lv2/meson.build @@ -0,0 +1,25 @@ +module = shared_module('missing_port_name', + files('missing_port_name.c'), + c_args: c_suppressions, + dependencies: lv2_dep, + gnu_symbol_visibility: 'hidden', + name_prefix: '') + +extension = '.' + module.full_path().split('.')[-1] +config = configuration_data({'SHLIB_EXT': extension}) +ttl_files = ['manifest.ttl', 'missing_port_name.ttl'] + +foreach f : ttl_files + configure_file(input: files(f + '.in'), + output: f, + configuration: config) +endforeach + +test('missing_port_name', + executable('test_missing_port_name', + files('test_missing_port_name.c'), + c_args: c_suppressions + test_args, + dependencies: [lv2_dep, lilv_static_dep]), + args: [meson.current_build_dir() / ''], + suite: 'plugin') + diff --git a/test/new_version.lv2/meson.build b/test/new_version.lv2/meson.build new file mode 100644 index 0000000..b745415 --- /dev/null +++ b/test/new_version.lv2/meson.build @@ -0,0 +1,17 @@ +module = shared_module('new_version', + files('new_version.c'), + c_args: c_suppressions, + dependencies: lv2_dep, + gnu_symbol_visibility: 'hidden', + name_prefix: '') + +extension = '.' + module.full_path().split('.')[-1] +config = configuration_data({'SHLIB_EXT': extension}) +ttl_files = ['manifest.ttl', 'new_version.ttl'] + +foreach f : ttl_files + configure_file(input: files(f + '.in'), + output: f, + configuration: config) +endforeach + diff --git a/test/old_version.lv2/meson.build b/test/old_version.lv2/meson.build new file mode 100644 index 0000000..efec6e1 --- /dev/null +++ b/test/old_version.lv2/meson.build @@ -0,0 +1,17 @@ +module = shared_module('old_version', + files('old_version.c'), + c_args: c_suppressions, + dependencies: lv2_dep, + gnu_symbol_visibility: 'hidden', + name_prefix: '') + +extension = '.' + module.full_path().split('.')[-1] +config = configuration_data({'SHLIB_EXT': extension}) +ttl_files = ['manifest.ttl', 'old_version.ttl'] + +foreach f : ttl_files + configure_file(input: files(f + '.in'), + output: f, + configuration: config) +endforeach + diff --git a/test/test.lv2/manifest.ttl.in b/test/test_plugin.lv2/manifest.ttl.in index bc3952c..48b009b 100644 --- a/test/test.lv2/manifest.ttl.in +++ b/test/test_plugin.lv2/manifest.ttl.in @@ -3,5 +3,5 @@ <http://example.org/lilv-test-plugin> a lv2:Plugin ; - lv2:binary <test@SHLIB_EXT@> ; - rdfs:seeAlso <test.ttl> . + lv2:binary <test_plugin@SHLIB_EXT@> ; + rdfs:seeAlso <test_plugin.ttl> . diff --git a/test/test_plugin.lv2/meson.build b/test/test_plugin.lv2/meson.build new file mode 100644 index 0000000..2a4273d --- /dev/null +++ b/test/test_plugin.lv2/meson.build @@ -0,0 +1,17 @@ +module = shared_module('test_plugin', + files('test_plugin.c'), + c_args: c_suppressions, + dependencies: lv2_dep, + gnu_symbol_visibility: 'hidden', + name_prefix: '') + +extension = '.' + module.full_path().split('.')[-1] +config = configuration_data({'SHLIB_EXT': extension}) +ttl_files = ['manifest.ttl', 'test_plugin.ttl'] + +foreach f : ttl_files + configure_file(input: files(f + '.in'), + output: f, + configuration: config) +endforeach + diff --git a/test/test.lv2/test.c b/test/test_plugin.lv2/test_plugin.c index 1dc7076..9615fff 100644 --- a/test/test.lv2/test.c +++ b/test/test_plugin.lv2/test_plugin.c @@ -15,8 +15,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define _POSIX_C_SOURCE 200809L - #include "lv2/atom/atom.h" #include "lv2/core/lv2.h" #include "lv2/state/state.h" diff --git a/test/test.lv2/test.ttl.in b/test/test_plugin.lv2/test_plugin.ttl.in index 1c16b4c..1c16b4c 100644 --- a/test/test.lv2/test.ttl.in +++ b/test/test_plugin.lv2/test_plugin.ttl.in diff --git a/test/test_string.c b/test/test_string.c index dcfd894..4b718b5 100644 --- a/test/test_string.c +++ b/test/test_string.c @@ -14,8 +14,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define _POSIX_C_SOURCE 200809L /* for setenv */ - #undef NDEBUG #include "../src/lilv_internal.h" |