-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Location #241
Location #241
Conversation
…the filename of the caller
@@ -1466,10 +1477,23 @@ template <class... Ts, class TEvent> | |||
struct test { | |||
utility::string_view type{}; | |||
utility::string_view name{}; | |||
reflection::source_location location; | |||
|
|||
constexpr test(std::initializer_list<utility::string_view> l, const reflection::source_location& currentLocation = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid that this solution will always produce ut.hpp as the file_name 🤔 I believe to get it working we have to do it in the callee side, in ""_test in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arg, I thought it work due to a cache of another include that filled the filename (it was for another test). I though I removed, but it's seems I didn't. When it worked I just pressumed UDL was simply syntax sugar and that the compiler was really calling the contructor directily (thus with the default value location parameter). Not the case then. Forget about this attempt then :(
This is a first try at at adding the location information of the caller to the test constructor to be able to have the filename available to the test_begin data structure. Ignore the exception stuff (as it belongs to another PR) and see what you think. Maybe the initializer list can became a variadic template. But before I improve this, I wanna to see if this is an agreeable path forward.