From 1f39b7d869e517ccc31230efbec903bbcf59ef97 Mon Sep 17 00:00:00 2001 From: Kris Jusiak Date: Tue, 15 Oct 2024 02:57:52 +0100 Subject: [PATCH] :bug: [compile-time] current_test_name fixup --- ut | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ut b/ut index 511b877..00c2a70 100644 --- a/ut +++ b/ut @@ -939,12 +939,12 @@ struct test { struct run { template constexpr run(T test, const char* file_name = __builtin_FILE(), int line = __builtin_LINE()) : result{[&] { - if constexpr (requires { cfg(test).current_test_name; }) { - cfg(test).current_test_name = Name.data(); - } if (__builtin_is_constant_evaluated()) { return cfg(test).runner.on(events::run{test, file_name, line, Name.data()}); } else { + if constexpr (requires { cfg(test).current_test_name; }) { + cfg(test).current_test_name = Name.data(); + } return cfg(test).runner.on(events::run{test, file_name, line, Name.data(), getenv("UT_FILTER")}); } }()}