From: Vladimír Čunát Date: Tue, 20 May 2025 06:28:32 +0000 (+0200) Subject: tests: add check for C++ compatibility in headers X-Git-Tag: v6.0.13~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fenvironments%2Fdocs-cpp-compat-c7btca%2Fdeployments%2F6825;p=thirdparty%2Fknot-resolver.git tests: add check for C++ compatibility in headers --- diff --git a/tests/lib-includes.cpp b/tests/lib-includes.cpp new file mode 100644 index 000000000..8924171f5 --- /dev/null +++ b/tests/lib-includes.cpp @@ -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() +{ +} diff --git a/tests/meson.build b/tests/meson.build index 3b2bb6548..c86de2090 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -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