]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
tests: add check for C++ compatibility in headers docs-cpp-compat-c7btca/deployments/6825
authorVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 20 May 2025 06:28:32 +0000 (08:28 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 20 May 2025 06:28:32 +0000 (08:28 +0200)
tests/lib-includes.cpp [new file with mode: 0644]
tests/meson.build

diff --git a/tests/lib-includes.cpp b/tests/lib-includes.cpp
new file mode 100644 (file)
index 0000000..8924171
--- /dev/null
@@ -0,0 +1,13 @@
+
+extern "C" {
+       #include "lib/utils.h"
+       #include "lib/resolve.h"
+       #include "lib/module.h"
+       #include "lib/layer.h"
+       #include "lib/rplan.h"
+       #include "lib/rules/api.h"
+}
+
+int main()
+{
+}
index 3b2bb6548976955b485ffef016202de255755aea..c86de209019a6ffd5874c313246dde576f0dc442 100644 (file)
@@ -58,3 +58,17 @@ if build_extra_tests
   endforeach
   message('--------------------------------')
 endif
+
+if build_extra_tests
+  # Just try that C++ compiler can chew through our library includes.
+  cpp_test = executable(
+    'cpp-lib-includes',
+    files(['lib-includes.cpp']),
+    dependencies: [
+      kresconfig_dep,
+      contrib_dep,
+      libkres_dep,
+      libknot,
+    ],
+  )
+endif