From 496d9fc5827124536089c77d7ed29b7728c94380 Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:10:07 +0000 Subject: [PATCH] chore(build): containers, toolchains and portability fixes --- include/Void/Testing/Suite.hpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/include/Void/Testing/Suite.hpp b/include/Void/Testing/Suite.hpp index 0cc32bd..5583db1 100644 --- a/include/Void/Testing/Suite.hpp +++ b/include/Void/Testing/Suite.hpp @@ -1,7 +1,6 @@ #pragma once #include -#include #include #include #include @@ -11,6 +10,7 @@ #if __has_include() #include +#include #define VOID_TESTING_HAS_REFLECTION 1 #endif @@ -95,6 +95,13 @@ namespace Void::Testing } } + /// Non-capturing thunk: a template argument is a constant + /// expression, unlike a reflected member captured by a lambda. + template static void run_method_thunk() + { + run_method(); + } + static std::string suite_label() { if constexpr (constexpr auto n = @@ -138,12 +145,17 @@ namespace Void::Testing skip_reason = std::string{s->reason.view()}; } + constexpr auto name = meta::identifier_of(m); + constexpr const char* file = loc.file_name(); + constexpr int line = + static_cast(loc.line()); + constexpr auto run = &run_method_thunk; reg.add(TestCase{ - .run = [] { run_method(); }, - .name = std::string{meta::identifier_of(m)}, + .run = run, + .name = std::string{name}, .suite = suite, - .file = loc.file_name(), - .line = static_cast(loc.line()), + .file = file, + .line = line, .disabled = disabled, .skip_reason = std::move(skip_reason), .tags = std::move(tags),