Skip to content

Commit

Permalink
🐛 [compile-time] current_test_name fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
kris-jusiak committed Oct 15, 2024
1 parent 42922c4 commit 1f39b7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ut
Original file line number Diff line number Diff line change
Expand Up @@ -939,12 +939,12 @@ struct test {
struct run {
template<class T> 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")});
}
}()}
Expand Down

0 comments on commit 1f39b7d

Please sign in to comment.