commit 4c8b4283a5bdc4901e3d541a3a7c593b6ee66c1e
parent 99118ccc8214ea2ac3566bbe1e4fb81258f5b056
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date: Thu, 26 Oct 2023 14:05:20 +0200
meson: add more tests in lib/
Diffstat:
5 files changed, 118 insertions(+), 7 deletions(-)
diff --git a/src/lib/gnsrecord/meson.build b/src/lib/gnsrecord/meson.build
@@ -29,3 +29,58 @@ libgnunetgnsrecordjson = library('gnunetgnsrecordjson',
install: true,
install_dir: get_option('libdir'))
libgnunetgnsrecordjson_dep = declare_dependency(link_with : libgnunetgnsrecordjson)
+
+testgnsrecrd_perf_crypto = executable ('perf_gnsrecord_crypto',
+ ['perf_gnsrecord_crypto.c'],
+ dependencies: [libgnunetutil_dep,
+ libgnunetgnsrecord_dep],
+ include_directories: [incdir, configuration_inc],
+ build_by_default: false,
+ install: false)
+testgnsrecrd_test_crypto = executable ('test_gnsrecord_crypto',
+ ['test_gnsrecord_crypto.c'],
+ dependencies: [libgnunetutil_dep,
+ libgnunetgnsrecord_dep],
+ include_directories: [incdir, configuration_inc],
+ build_by_default: false,
+ install: false)
+testgnsrecrd_test_serialization = executable ('test_gnsrecord_serialization',
+ ['test_gnsrecord_serialization.c'],
+ dependencies: [libgnunetutil_dep,
+ libgnunetgnsrecord_dep],
+ include_directories: [incdir, configuration_inc],
+ build_by_default: false,
+ install: false)
+testgnsrecrd_test_tvs = executable ('test_gnsrecord_testvectors',
+ ['test_gnsrecord_testvectors.c'],
+ dependencies: [libgnunetutil_dep,
+ libgnunetgnsrecord_dep],
+ include_directories: [incdir, configuration_inc],
+ build_by_default: false,
+ install: false)
+testgnsrecrd_test_exp = executable ('test_gnsrecord_block_expiration',
+ ['test_gnsrecord_block_expiration.c'],
+ dependencies: [libgnunetutil_dep,
+ libgnunetgnsrecord_dep],
+ include_directories: [incdir, configuration_inc],
+ build_by_default: false,
+ install: false)
+
+test('perf_gnsrecord_crypto', testgnsrecrd_perf_crypto,
+ workdir: meson.current_build_dir(),
+ suite: ['gnsrecord'])
+test('test_gnsrecord_crypto', testgnsrecrd_test_crypto,
+ workdir: meson.current_build_dir(),
+ suite: ['gnsrecord'])
+test('test_gnsrecord_serialization', testgnsrecrd_test_serialization,
+ workdir: meson.current_build_dir(),
+ suite: ['gnsrecord'])
+test('test_gnsrecord_block_expiration', testgnsrecrd_test_exp,
+ workdir: meson.current_build_dir(),
+ suite: ['gnsrecord'])
+test('test_gnsrecord_serialization', testgnsrecrd_test_serialization,
+ workdir: meson.current_build_dir(),
+ suite: ['gnsrecord'])
+test('test_gnsrecord_testvectors', testgnsrecrd_test_tvs,
+ workdir: meson.current_build_dir(),
+ suite: ['gnsrecord'])
diff --git a/src/lib/hello/meson.build b/src/lib/hello/meson.build
@@ -13,11 +13,15 @@ pkg.generate(libgnunethello, url: 'https://www.gnunet.org',
description : 'Helper library for handling GNUnet HELLO messages')
-# TNG
-#executable ('gnunet-hello',
-# ['gnunet-hello.c'],
-# dependencies: [libgnunethello_dep, libgnunetutil_dep],
-# include_directories: [incdir, configuration_inc],
-# install: true,
-# install_dir: get_option('bindir'))
+test_hello_uri = executable ('test_hello_uri',
+ ['test_hello-uri.c'],
+ dependencies: [libgnunethello_dep,
+ libgnunetutil_dep,
+ gcrypt_dep],
+ include_directories: [incdir, configuration_inc],
+ build_by_default: false,
+ install: false)
+test('test_hello_uri', test_hello_uri,
+ workdir: meson.current_build_dir(),
+ suite: ['hello'])
diff --git a/src/lib/json/meson.build b/src/lib/json/meson.build
@@ -16,3 +16,29 @@ libgnunetjson_dep = declare_dependency(link_with : libgnunetjson)
pkg.generate(libgnunetjson, url: 'https://www.gnunet.org',
description : 'Library for JSON de/serialization')
+testjson = executable ('test_json',
+ ['test_json.c'],
+ dependencies: [libgnunetutil_dep,
+ json_dep,
+ libgnunetjson_dep],
+ include_directories: [incdir, configuration_inc],
+ build_by_default: false,
+ install: false)
+testjson_mhd = executable ('test_json_mhd',
+ ['test_json_mhd.c'],
+ dependencies: [libgnunetutil_dep,
+ json_dep,
+ mhd_dep,
+ curl_dep,
+ zlib_dep,
+ libgnunetjson_dep],
+ include_directories: [incdir, configuration_inc],
+ build_by_default: false,
+ install: false)
+test('test_json', testjson,
+ workdir: meson.current_build_dir(),
+ suite: ['json'])
+test('test_json_mhd', testjson_mhd,
+ workdir: meson.current_build_dir(),
+ suite: ['json'])
+
diff --git a/src/lib/pq/meson.build b/src/lib/pq/meson.build
@@ -16,3 +16,17 @@ libgnunetpq = library('gnunetpq',
install: true,
install_dir: get_option('libdir'))
libgnunetpq_dep = declare_dependency(link_with : libgnunetpq)
+
+testpq = executable ('test_pq',
+ ['test_pq.c'],
+ dependencies: [libgnunetutil_dep,
+ pq_dep,
+ libgnunetpq_dep],
+ include_directories: [incdir, configuration_inc],
+ build_by_default: false,
+ install: false)
+test('test_pq', testpq,
+ workdir: meson.current_build_dir(),
+ suite: ['pq'])
+
+
diff --git a/src/lib/sq/meson.build b/src/lib/sq/meson.build
@@ -15,4 +15,16 @@ libgnunetsq = library('gnunetsq',
pkg.generate(libgnunetsq, url: 'https://www.gnunet.org',
description : 'Provides API for accessing the SQ service')
libgnunetsq_dep = declare_dependency(link_with : libgnunetsq)
+testsq = executable ('test_sq',
+ ['test_sq.c'],
+ dependencies: [libgnunetutil_dep,
+ sqlite_dep,
+ libgnunetsq_dep],
+ include_directories: [incdir, configuration_inc],
+ build_by_default: false,
+ install: false)
+test('test_sq', testsq,
+ workdir: meson.current_build_dir(),
+ suite: ['sq'])
+