diff options
author | Marvin W <git@larma.de> | 2024-12-31 17:42:23 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2025-01-12 20:00:51 +0100 |
commit | b98b597c92ad9d2372af1672a5efe5166005d039 (patch) | |
tree | b421f97a50f81f7fb86455c19a2fc3ddaff9d5c4 /plugins | |
parent | fb26066be480654ba92e15397c5c1808605ed446 (diff) | |
download | dino-b98b597c92ad9d2372af1672a5efe5166005d039.tar.gz dino-b98b597c92ad9d2372af1672a5efe5166005d039.zip |
Meson: Add tests
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/omemo/meson.build | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/omemo/meson.build b/plugins/omemo/meson.build index f1fdb46d..391a0a98 100644 --- a/plugins/omemo/meson.build +++ b/plugins/omemo/meson.build @@ -63,6 +63,28 @@ c_args = [ ] vala_args = [ '--vapidir', meson.current_source_dir() / 'vapi', + # This is to build internal vapi for tests + '--header', meson.current_build_dir() / 'omemo.h', + '--internal-vapi', meson.current_build_dir() / 'omemo-internal.vapi', + '--internal-header', meson.current_build_dir() / 'omemo-internal.h', ] lib_omemo = shared_library('omemo', sources, name_prefix: '', c_args: c_args, vala_args: vala_args, include_directories: include_directories('src'), dependencies: dependencies, install: true, install_dir: get_option('libdir') / 'dino/plugins') dep_omemo = declare_dependency(link_with: lib_omemo, include_directories: include_directories('.')) +# This is to use the internal vapi instead of the regular +vapi_omemo_internal = custom_target('omemo-internal-vapi', command: [find_program('touch'), meson.current_build_dir() / 'omemo-internal.vapi'], output: ['omemo-internal.vapi'], depends: lib_omemo) +dep_omemo_internal = declare_dependency(link_args: [lib_omemo.full_path()], include_directories: include_directories('.', 'src'), sources: [vapi_omemo_internal]) + +test_sources = [ + 'tests/signal/common.vala', + 'tests/signal/testcase.vala', + + 'tests/signal/curve25519.vala', + 'tests/signal/hkdf.vala', + 'tests/signal/session_builder.vala', +] +test_vala_args = [ + '--vapidir', meson.current_source_dir() / 'vapi', +] + +exe_omemo_test = executable('omemo-test', test_sources, c_args: c_args, vala_args: test_vala_args, dependencies: dependencies + dep_omemo_internal, build_rpath: '$ORIGIN', install: false) +test('Tests for omemo', exe_omemo_test) |