From 79a5788e180273f86270b739854819a094368dc0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 20 May 2025 08:28:32 +0200 Subject: [PATCH] tests: add check for C++ compatibility in headers --- tests/lib-includes.cpp | 13 +++++++++++++ tests/meson.build | 14 ++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 tests/lib-includes.cpp 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 -- 2.47.2