]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Add tests for remotebackend
authorFred Morcos <fred.morcos@open-xchange.com>
Tue, 28 Nov 2023 11:22:09 +0000 (12:22 +0100)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:58 +0000 (13:28 +0100)
modules/remotebackend/meson.build

index 0fbf1b1f9e09e5062468497080a6e8a40bc6bacd..7c221e967ebec3fda2b4283f206eabccc7300636 100644 (file)
@@ -42,3 +42,88 @@ if module_opt == 'static'
 else
   shared_module(module_backend_name, link_whole: lib, name_suffix: 'so')
 endif
+
+if get_option('unit-tests-backends')
+  libpdns_test_remotebackend = declare_dependency(
+    link_with: static_library(
+      'pdns-test-remotebackend',
+      sources: [
+        'httpconnector.cc',
+       'pipeconnector.cc',
+       'remotebackend.cc',
+       'unixconnector.cc',
+       'zmqconnector.cc',
+        'test-remotebackend.cc',
+      ],
+      extra_files: ['remotebackend.hh'],
+      dependencies: [
+        deps,
+        libpdns_dnslabeltext,
+        libpdns_pkcs11signers,
+
+        source_deps_cache['arguments.cc'],
+        source_deps_cache['auth-packetcache.cc'],
+        source_deps_cache['auth-querycache.cc'],
+        source_deps_cache['auth-zonecache.cc'],
+        source_deps_cache['base32.cc'],
+        source_deps_cache['base64.cc'],
+        source_deps_cache['dns.cc'],
+        source_deps_cache['dnsbackend.cc'],
+        source_deps_cache['dnsname.cc'],
+        source_deps_cache['dnspacket.cc'],
+        source_deps_cache['dnsparser.cc'],
+        source_deps_cache['dnsrecords.cc'],
+        source_deps_cache['dnssecinfra.cc'],
+        source_deps_cache['dnswriter.cc'],
+        source_deps_cache['ednscookies.cc'],
+        source_deps_cache['ednsoptions.cc'],
+        source_deps_cache['ednssubnet.cc'],
+        source_deps_cache['gss_context.cc'],
+        source_deps_cache['iputils.cc'],
+        source_deps_cache['json.cc'],
+        source_deps_cache['logger.cc'],
+        source_deps_cache['misc.cc'],
+        source_deps_cache['nameserver.cc'],
+        source_deps_cache['nsecrecords.cc'],
+        source_deps_cache['qtype.cc'],
+        source_deps_cache['rcpgenerator.cc'],
+        source_deps_cache['shuffle.cc'],
+        source_deps_cache['sillyrecords.cc'],
+        source_deps_cache['statbag.cc'],
+        source_deps_cache['svc-records.cc'],
+        source_deps_cache['ueberbackend.cc'],
+        source_deps_cache['unix_utility.cc'],
+      ],
+    )
+  )
+
+  test_binaries = [
+    'test-remotebackend-http',
+    'test-remotebackend-json',
+    'test-remotebackend-pipe',
+    'test-remotebackend-post',
+    'test-remotebackend-unix',
+    'test-remotebackend-zeromq',
+  ]
+
+  env = {
+    'BOOST_TEST_LOG_LEVEL': 'message',
+    'REMOTEBACKEND_ZEROMQ': get_option('module-remote-zeromq') ? '1' : '0',
+  }
+
+  foreach test_binary: test_binaries
+    name = 'pdns_' + test_binary.underscorify()
+
+    set_variable(
+      name,
+      executable(
+        'pdns-' + test_binary,
+        sources: [test_binary + '.cc'],
+        extra_files: ['test-remotebackend-keys.hh'],
+        dependencies: [module_deps, libpdns_test_remotebackend, dep_boost_test],
+      )
+    )
+
+    test('PDNS Auth ' + test_binary, get_variable(name), verbose: true, env: env)
+  endforeach
+endif